MCNNRunner Class Reference

#include <MCNNRunner.h>

List of all members.

Public Member Functions

 MCNNRunner ()
 ~MCNNRunner ()
void Run (const char *fname, const char *tag, unsigned short qtype)
void Run (const char *fname, const char *tag, Int_t entry_first, Int_t entry_last, Int_t piece_in, unsigned short qtype)
void Run (const char *fname, unsigned short qtype)
void Run (const char *fname, Int_t entry_first, Int_t entry_last, Int_t piece_in, unsigned short qtype)
void SetMCNNPrecutLevel (int level)
int GetMCNNPrecutLevel ()

Private Member Functions

void Initialize (unsigned short qtype)
void ReadEventLibrary ()
bool NextLibraryEvent ()
void CompactInput (const char *fname, unsigned short qtype)
void MakeComparison ()
void WriteResults (const char *fname, const char *tag)
void WriteResults (const char *fname)
void Finish ()
ComparisonResultCompareEventsP (MinosCompactEvent *eventA, MinosCompactEvent *eventB, float toBeat=NO_VALID_COMPARISON)
comparisonResult_h CompareEvents (MinosCompactEvent *eventA, MinosCompactEvent *eventB, float toBeat=NO_VALID_COMPARISON)
comparisonResult_h CompareEventsBody (MinosCompactEvent *eventA, MinosCompactEvent *eventB, float toBeat=NO_VALID_COMPARISON)
bool CompatibleEvents (compatibilityInfo_h *ciA, compatibilityInfo_h *ciB)
Bool_t PassesMCNNPrecuts (const NtpStRecord *record, const int eventno) const

Private Attributes

unsigned int file_count
Int_t srCtr
Int_t input_first
Int_t input_last
Int_t piece
bool isMRCC
int KEEP_BEST_N
int MCNNPrecutLevel
bool atleastonelibevent
int library_event_count
TChain * lib_chain
std::vector< string > _files
std::vector< ComparisonResultList * > _compResList
std::vector< MinosCompactEvent * > _inputAll
std::vector< compatibilityInfo_h * > _inputAll_compatibilityInfo
std::vector< float > _selflnL
std::vector< float > _compResList_smallestDeltalnL
std::vector< int > _compResList_size
std::vector< ComparisonResultList * > _compResList_untrimmed
std::vector< MinosCompactEvent * > _inputAll_untrimmed
PECalculatorpeCalculator
HitProbTableHPB
MinosEventDisplayeventDisplay
MinosCompactEventpcce


Detailed Description

Definition at line 43 of file MCNNRunner.h.


Constructor & Destructor Documentation

MCNNRunner::MCNNRunner (  ) 

Definition at line 73 of file MCNNRunner.cxx.

References atleastonelibevent, input_first, input_last, KEEP_BEST_N, kLoosePrecuts, lib_chain, library_event_count, and piece.

00073                       {
00074 
00075   KEEP_BEST_N=200;//<--default values
00076   input_last=100000000;//<--some humongously large number
00077   input_first=0;
00078   piece=-1;
00079   MCNNPrecutLevel = kLoosePrecuts;
00080   atleastonelibevent=false;
00081   library_event_count = 0;
00082   lib_chain = 0;
00083 
00084 }

MCNNRunner::~MCNNRunner (  ) 

Definition at line 86 of file MCNNRunner.cxx.

00086                        {
00087 
00088 }


Member Function Documentation

void MCNNRunner::CompactInput ( const char *  fname,
unsigned short  qtype 
) [private]

Definition at line 358 of file MCNNRunner.cxx.

References _compResList, _compResList_size, _compResList_smallestDeltalnL, _compResList_untrimmed, _inputAll, _inputAll_compatibilityInfo, _inputAll_untrimmed, _selflnL, CompareEvents(), CompatibleEvents(), count, NtpStRecord::evthdr, input_first, input_last, ComparisonResultList::LastDeltalnL(), comparisonResult_h::lnL, NtpSREventSummary::nevent, NO_VALID_COMPARISON, MinosCompactEvent::nPlanes, compatibilityInfo_h::nplanes, compatibilityInfo_h::nstrips, PassesMCNNPrecuts(), MinosCompactEvent::Qtot, compatibilityInfo_h::qtot, ComparisonResultList::Size(), MinosCompactEvent::UStrips, and MinosCompactEvent::VStrips.

Referenced by Run().

00358                                                                     {
00359 
00360   cout << "*** CompactInput ***" << endl;
00361  //New pattern is truncated after strip 15
00362   static const int PATTERN_SIZE = 7;
00363   int cpattern[PATTERN_SIZE] = {1,1,2,3,4,5,85};
00364   int pattern[201];
00365   pattern[100] = 100;
00366   int ip = 100;
00367   int im = 100;
00368   int ipp = 100; 
00369   int imm = 100;
00370 
00371   //Mark strips >15 from mean as strips to be cut in compression
00372   for(int entry =1;entry<PATTERN_SIZE;entry++){
00373     ipp++;
00374     imm--;
00375     for(int count=0;count<cpattern[entry];count++){
00376       ip++;
00377       im--;
00378       if(ip<=115){ 
00379         pattern[ip] = ipp;
00380       } else if (ip<=200) pattern[ip]=-1;
00381       if(im>=85&&im<=100){
00382         pattern[im] = imm;
00383       } else if (im>=0) pattern[im]=-1;
00384    
00385     }
00386   }
00387 
00388   //-->Opening input file
00389   //NtpFile* input  = new NtpFile(isMC,isMRCC);
00390   TChain *chain = new TChain("NtpSt");
00391   cout << "Adding INPUT file to list: " << fname << endl;
00392   //input->AddFiles(fname);
00393   chain->Add(fname);
00394 
00395   // report
00396   cout << "Applying MCNN precuts at level=" << MCNNPrecutLevel << endl;
00397   Int_t precutDenom = 0;
00398   Int_t precutNumer = 0;
00399 
00400   const NtpStRecord *record = 0;
00401   chain->SetBranchAddress("NtpStRecord",&record);
00402 
00403   Int_t srCtr_local=input_first;
00404   while(chain->GetEntry(srCtr_local) && srCtr_local<=input_last){
00405     ++srCtr_local;
00406 
00407     for(int ievt=0;ievt<record->evthdr.nevent;++ievt){
00408 
00409       MinosCompactEvent* pCompactEvent = new MinosCompactEvent(record, ievt, qtype);
00410       MinosCompactEvent* pCompressedCompactEvent = new MinosCompactEvent(pCompactEvent,pattern);
00411 
00412       delete pCompactEvent;
00413 
00414       //-->create a ComparisonResultList object for this input event
00415       ComparisonResultList *crl = new ComparisonResultList();
00416       
00417       // precuts
00418       Bool_t stripcheck = kTRUE;
00419       if (pCompressedCompactEvent->UStrips.size()==0&&
00420           pCompressedCompactEvent->VStrips.size()==0) stripcheck = kFALSE;
00421 
00422       Bool_t doit = PassesMCNNPrecuts(record,ievt) && stripcheck;
00423       precutDenom++; // counter
00424       
00425       // push (pointers only) to these untrimmed lists so that the writing
00426       // code has something to work with for all input events, regardless
00427       // of precuts.
00428       // These should be a full list of lists used in the output.
00429       _inputAll_untrimmed.push_back(pCompressedCompactEvent);
00430       _compResList_untrimmed.push_back(crl);  
00431 
00432       if (doit) {
00433         // push here those events that should actually be processed.
00434         precutNumer++; // counter
00435 
00436         _inputAll.push_back(pCompressedCompactEvent);
00437         compatibilityInfo_h *ci = new compatibilityInfo_h;
00438         ci->nstrips = pCompressedCompactEvent->UStrips.size()+pCompressedCompactEvent->VStrips.size();
00439         ci->qtot    = pCompressedCompactEvent->Qtot;
00440         ci->nplanes = pCompressedCompactEvent->nPlanes;
00441         _inputAll_compatibilityInfo.push_back(ci);
00442       
00443         //-->compare with self and store
00444         if (CompatibleEvents(ci,ci)) { 
00445           comparisonResult_h selfcomp = CompareEvents(pCompressedCompactEvent,pCompressedCompactEvent);
00446           _selflnL.push_back(selfcomp.lnL);
00447         } else _selflnL.push_back(NO_VALID_COMPARISON-1.0);
00448       
00449         //set the CR list's size (for speed later)
00450         _compResList.push_back(crl);  
00451         _compResList_size.push_back(crl->Size());
00452         _compResList_smallestDeltalnL.push_back(crl->LastDeltalnL());
00453         
00454       }
00455 
00456     }//evt loop
00457 
00458   }//next record loop
00459 
00460   //Check all is OK
00461   if(_inputAll.size()==_selflnL.size() && _selflnL.size()==_compResList.size() && _compResList.size()==_compResList_size.size() ){
00462     cout << "Saved " << _compResList.size() << " input events with self lnL and comp. result lists. " << endl;
00463   } else {
00464     cout << "ERROR !!!; _inputAll, _selflnL, _compResList, and_compResList_size do not have same number of entries; suggest to abort" << endl;
00465   }
00466 
00467   //Delete file
00468   //delete input;
00469   delete chain;//new
00470 
00471   // report on precuts
00472   cout << "Precuts: Running MCNN on " << precutNumer << " of " << precutDenom << " events" << endl;
00473 }//end of CompactInput

comparisonResult_h MCNNRunner::CompareEvents ( MinosCompactEvent eventA,
MinosCompactEvent eventB,
float  toBeat = NO_VALID_COMPARISON 
) [private]

Definition at line 1410 of file MCNNRunner.cxx.

References MinosCompactEvent::AllStrips, CompareEventsBody(), comparisonResult_h::lnL, NO_VALID_COMPARISON, comparisonResult_h::planeOffset, comparisonResult_h::stripOffsetU, and comparisonResult_h::stripOffsetV.

Referenced by CompactInput(), and CompareEventsP().

01411 {
01412   comparisonResult_h bestResult;
01413 
01414   float lnLmax = NO_VALID_COMPARISON;
01415 
01416   for(int iPlaneOffset = -1; iPlaneOffset <= +1; ++iPlaneOffset){
01417     // Apply plane shift. It is only safe not to resort the list here
01418     // because of the way comparison is defined in compactStrip_h
01419     // ie planes is the least-significant factor in the comparison.
01420     // If U & V shifts are reintroduced something cleverer will have to
01421     // be done.
01422     typedef vector<compactStrip_h>::iterator it_t;
01423     const it_t endA = eventA->AllStrips.end();
01424     for(it_t itA = eventA->AllStrips.begin(); itA != endA; ++itA)
01425       itA->plane += iPlaneOffset;
01426 
01427     comparisonResult_h result = CompareEventsBody(eventA, eventB, toBeat);
01428 
01429     // Now that we have a good enough result, the criterion for further plane
01430     // shifts is to beat this new value.
01431     if(result.lnL > toBeat) toBeat = result.lnL;
01432 
01433     // Undo plane shift
01434     for(it_t itA = eventA->AllStrips.begin(); itA != endA; ++itA)
01435       itA->plane -= iPlaneOffset;
01436 
01437     if(result.lnL > lnLmax){
01438       lnLmax = result.lnL;
01439       bestResult = result;
01440       bestResult.stripOffsetU = 0;
01441       bestResult.stripOffsetV = 0;
01442       bestResult.planeOffset = iPlaneOffset;
01443     }
01444   } // end for iPlaneOffset
01445 
01446   return bestResult;
01447 }

comparisonResult_h MCNNRunner::CompareEventsBody ( MinosCompactEvent eventA,
MinosCompactEvent eventB,
float  toBeat = NO_VALID_COMPARISON 
) [private]

Definition at line 1460 of file MCNNRunner.cxx.

References MinosCompactEvent::AllStrips, MinosCompactEvent::chargeScale, MinosCompactEvent::ChargeType, comparisonResult_h::fractionQMatched, HPB, comparisonResult_h::lnL, HitProbTable::LogL(), comparisonResult_h::nMatched, comparisonResult_h::nUnmatched, peCalculator, and PECalculator::SimpleLnL().

Referenced by CompareEvents().

01461 {
01462   // We start with two sorted lists containing all the strips in each event.
01463   // The goal is to find all matching strips, unpaired strips are taken to
01464   // "match" a strip of zero charge.
01465   //
01466   // We go through both lists simultaneously, noticing when we are looking at
01467   // identical strips in each. If the two current strips don't match then whichever
01468   // strip comes earlier in sequence definitely doesn't have a match in the other list.
01469   //
01470   // If our likelihood is ever lower than toBeat then we can bail out early, safe in
01471   // the knowledge that the likelihood of this match can never matter.
01472 
01473   float lnL = 0;
01474   int nmatched = 0;
01475   int nunmatched = 0;
01476   float qmatched = 0;
01477   float qunmatched = 0;
01478 
01479   if(eventA->ChargeType != eventB->ChargeType){
01480     cout << "UTTER FAILURE - Events have different ChargeType" << endl;
01481   }
01482   if(eventA->chargeScale != eventB->chargeScale){
01483     cout << "UTTER FAILURE - Events have different chargeScale" << endl;
01484   }
01485 
01486   const float CS = eventA->chargeScale;
01487   const unsigned short int QT = eventA->ChargeType;
01488 
01489   typedef vector<compactStrip_h>::const_iterator it_t;
01490   it_t itA = eventA->AllStrips.begin();
01491   it_t itB = eventB->AllStrips.begin();
01492   const it_t endA = eventA->AllStrips.end();
01493   const it_t endB = eventB->AllStrips.end();
01494 
01495   // Ensure the AllStrips vectors have been filled
01496   assert(itA != endA);
01497   assert(itB != endB);
01498 
01499   // So long as we have strips left in either list
01500   while(itA != endA || itB != endB){
01501 
01502     int nchargeA = -1;
01503     int nchargeB = -1;
01504 
01505     if(itA != endA && itB != endB &&
01506        itA->plane == itB->plane && itA->strip == itB->strip){
01507       // Both strips exist and have identical positions
01508 
01509       nchargeA = int(itA->icharge/CS + 0.5);
01510       nchargeB = int(itB->icharge/CS + 0.5);
01511 
01512       nmatched += 2;
01513       qmatched += itA->icharge + itB->icharge;
01514 
01515       ++itA;
01516       ++itB;
01517     }
01518     else if(itB == endB || (itA != endA && *itA < *itB)){
01519       // Either there are no more strips in B,
01520       // or the strip in A is earlier than the one in B.
01521       // In either case *itA doesn't have a match in B
01522 
01523       nchargeA = int(itA->icharge/CS + 0.5);
01524       nchargeB = 0;
01525 
01526       ++nunmatched;
01527       qunmatched += itA->icharge;
01528 
01529       ++itA;
01530     }
01531     else if(itA == endA || (itB != endB && *itB < *itA)){
01532       // As above. Here *itB doesn't have a match in A...
01533 
01534       nchargeA = 0;
01535       nchargeB = int(itB->icharge/CS + 0.5);
01536 
01537       ++nunmatched;
01538       qunmatched += itB->icharge;
01539 
01540       ++itB;
01541     }
01542     else{
01543       assert(0 && "This should never happen");
01544     }
01545 
01546     // Double-check that the charges got filled in.
01547     if (nchargeA<0 || nchargeB<0) {
01548       std::cout << "UNEXPECTED! -- " << nchargeA << " " << nchargeB << std::endl;
01549     }
01550     //assert(nchargeA >= 0 && nchargeB >= 0);
01551 
01552     // Calculate the likelihood of these two charges in one of two ways
01553     switch(QT){
01554     case 1: case 2: case 3: case 4: case 6:
01555       lnL += HPB->LogL(nchargeA, nchargeB);
01556       break;
01557     case 0: case 5:
01558       lnL += peCalculator->SimpleLnL(nchargeA, nchargeB);
01559       break;
01560     default:
01561       assert(0 && "Unknown charge type");
01562     };
01563 
01564     // Might as well return what we have already since it can't possibly win
01565     if(lnL < toBeat) break;
01566 
01567   } // end while
01568 
01569   comparisonResult_h result;
01570   result.lnL = lnL;
01571   result.nMatched = nmatched;
01572   result.nUnmatched = nunmatched;
01573   result.fractionQMatched = (qmatched+qunmatched) ? (qmatched/(qmatched+qunmatched)) : 0;
01574   return result;
01575 }

ComparisonResult * MCNNRunner::CompareEventsP ( MinosCompactEvent eventA,
MinosCompactEvent eventB,
float  toBeat = NO_VALID_COMPARISON 
) [private]

Definition at line 1451 of file MCNNRunner.cxx.

References CompareEvents(), comparisonResult_h::lnL, and NO_VALID_COMPARISON.

Referenced by MakeComparison().

01452 {
01453   comparisonResult_h result = CompareEvents(eventA, eventB, toBeat);
01454   if(result.lnL > NO_VALID_COMPARISON) return new ComparisonResult(result);
01455 
01456   return 0;
01457 }

bool MCNNRunner::CompatibleEvents ( compatibilityInfo_h ciA,
compatibilityInfo_h ciB 
) [private]

Definition at line 1384 of file MCNNRunner.cxx.

References compatibilityInfo_h::nplanes, compatibilityInfo_h::nstrips, and compatibilityInfo_h::qtot.

Referenced by CompactInput(), and MakeComparison().

01384                                                                                     {
01385 
01386   // This is the one routine that gets called (library)*(input) times.
01387   // It needs to be as tight as possible.
01388 
01389   int meanN  = (ciA->nplanes+ciB->nplanes+1)/2;
01390   int cut = 2;
01391   if      (meanN>20) cut=4;
01392   else if (meanN>15) cut=3;
01393   if (abs(ciA->nplanes-ciB->nplanes)>cut) return 0;
01394 
01395   if (ciA->nstrips+ciB->nstrips==0) return 0;
01396   float rat1 = 2.0*fabs(static_cast<float>(ciA->nstrips - ciB->nstrips))/(ciA->nstrips + ciB->nstrips);
01397   if (rat1>0.2) return 0;
01398 
01399   if (ciA->qtot+ciB->qtot==0) return 0;
01400   float rat2 = 2.0*fabs(static_cast<float>(ciA->qtot-ciB->qtot))/(ciA->qtot+ciB->qtot);
01401   if (rat2>0.2) return 0;
01402 
01403   return 1;
01404 }

void MCNNRunner::Finish (  )  [private]

Definition at line 1351 of file MCNNRunner.cxx.

References _compResList, _inputAll, _inputAll_compatibilityInfo, eventDisplay, and peCalculator.

Referenced by Run().

01351                        {
01352 
01353   //-->Tidy up
01354   cout << "Finishing; removing:" << endl;
01355 
01356   //objects
01357   if(peCalculator!=NULL)delete peCalculator;
01358   cout << "peCalculator " << endl;
01359   if(eventDisplay!=NULL)delete eventDisplay;
01360   cout << "eventDisplay" << endl;
01361 
01362   //std::vectors
01363   for(UInt_t ievent = 0; ievent<_inputAll.size();++ievent) {
01364     delete _inputAll[ievent];
01365     delete _inputAll_compatibilityInfo[ievent];
01366   }
01367   cout << "_inputAll (and related)" << endl;  
01368   for(UInt_t ievent = 0; ievent<_compResList.size();++ievent) {
01369     delete _compResList[ievent];
01370   }
01371   cout << "_compResList" << endl;
01372   
01373 
01374 }

int MCNNRunner::GetMCNNPrecutLevel (  )  [inline]

Definition at line 53 of file MCNNRunner.h.

00053 { return MCNNPrecutLevel; }

void MCNNRunner::Initialize ( unsigned short  qtype  )  [private]

Definition at line 192 of file MCNNRunner.cxx.

References file_count, HPB, isMRCC, pcce, peCalculator, and srCtr.

Referenced by Run().

00193 {
00194   cout << " *** Initialize() ***" << endl;
00195 
00196   //Other variables
00197   isMRCC=false;
00198 
00199   //Start library file & entry count at 0
00200   srCtr=0;
00201   file_count=0;  
00202 
00203   // create the event display if requested
00204   //if(EVENT_DISPLAY)eventDisplay = new MinosEventDisplay(0,true);
00205 
00206   // create the calculator
00207   //MHO0509 - Type of calculator needed depends on qtype
00208   if (qtype == 0 || qtype == 5) {
00209     peCalculator = new PECalculator();
00210   }
00211   if (qtype == 1 || qtype == 2) {
00212     TFile f("/minos/scratch/nue/Releases/Griffin/Data/LEM/hitprobtable/HitProbTableQtypes1and2.root");
00213     gROOT->cd();
00214     HPB = (HitProbTable*)f.Get("HPB");
00215     if (!HPB) {
00216       cout << "Failed to get HitProbTable from file.  SEGV coming!" << endl;
00217     }
00218     HPB = (HitProbTable*)HPB->Clone();
00219   }
00220   if (qtype == 3 || qtype == 4 || qtype == 6) {
00221     TFile f("/minos/scratch/nue/Releases/Griffin/Data/LEM/hitprobtable/HitProbTableQtypes3and4.root");
00222     gROOT->cd();
00223     HPB = (HitProbTable*)f.Get("HPB");
00224     if (!HPB) {
00225       cout << "Failed to get HitProbTable from file.  SEGV coming!" << endl;
00226     }
00227     HPB = (HitProbTable*)HPB->Clone();
00228   }
00229   
00230   // create the CCE
00231   pcce = new MinosCompactEvent(qtype);
00232 
00233   return;
00234 
00235 }

void MCNNRunner::MakeComparison (  )  [private]

Definition at line 479 of file MCNNRunner.cxx.

References _compResList, _compResList_size, _compResList_smallestDeltalnL, _inputAll, _inputAll_compatibilityInfo, _selflnL, atleastonelibevent, CompareEventsP(), CompatibleEvents(), ComparisonResult::dLnL, KEEP_BEST_N, library_event_count, ComparisonResult::lnL, NextLibraryEvent(), NO_VALID_COMPARISON, MinosCompactEvent::nPlanes, compatibilityInfo_h::nplanes, compatibilityInfo_h::nstrips, pcce, MinosCompactEvent::Qtot, compatibilityInfo_h::qtot, ComparisonResult::SetNeutrino(), MinosCompactEvent::UStrips, and MinosCompactEvent::VStrips.

Referenced by Run().

00479                                {
00480 
00481   //-->Looping over library events
00482   while(NextLibraryEvent()){
00483 
00484     library_event_count++;
00485     atleastonelibevent=true;
00486 
00487     // for the faster precut routine:
00488     compatibilityInfo_h *ci_lib = new compatibilityInfo_h;
00489     ci_lib->nstrips = pcce->UStrips.size()+pcce->VStrips.size();
00490     ci_lib->qtot    = pcce->Qtot;
00491     ci_lib->nplanes = pcce->nPlanes;
00492 
00493     //-->Looping over input events
00494 
00495     UInt_t total_input = _inputAll.size();
00496     std::vector<compatibilityInfo_h*>::iterator it = _inputAll_compatibilityInfo.begin();
00497 
00498     for(UInt_t ievent = 0; ievent<total_input;++ievent){    
00499       //cout << "===============================" << endl;//tmp
00500       //cout << "Library event: " << pcce->idnu << "," << pcce->idact << "," << pcce->eNu << " -- " << pcce->UStrips.size() << "," << pcce->VStrips.size() << endl;//tmp
00501 
00502       compatibilityInfo_h *ci_inp = *it++;
00503 
00504       if ( CompatibleEvents(ci_inp,ci_lib) ) {
00505         // passes matching precuts (slower)
00506 
00507         int nsize = 0;
00508         if(_compResList[ievent]) nsize = _compResList_size[ievent];
00509 
00510         float toBeat = NO_VALID_COMPARISON;
00511         // If the list of matches is already full, then an event will need at least this likelihood
00512         // to get into it. Let the CompareEvents function know so it can bail out early if possible.
00513         if(nsize >= KEEP_BEST_N) toBeat = _selflnL[ievent]-_compResList_smallestDeltalnL[ievent];
00514         ComparisonResult* pResult = CompareEventsP(_inputAll[ievent], pcce, toBeat);
00515 
00516         if(pResult){
00517           
00518           float deltaLnL = _selflnL[ievent] - pResult->lnL;
00519 
00520           //-->saving to the ComparisonResultList of this input event
00521           if(nsize < KEEP_BEST_N || deltaLnL<_compResList_smallestDeltalnL[ievent]){
00522             
00523             pResult->dLnL = deltaLnL;
00524             pResult->SetNeutrino(pcce);
00525             
00526             if(nsize==KEEP_BEST_N){//<--remove last
00527               // RBP - this was breaking.
00528               //list<ComparisonResult>::iterator iter_end = _compResList[ievent]->compResultList.end();
00529               //delete &iter_end;//<--actually deallocate memory for this object           
00530               _compResList[ievent]->PopBack();//<-- remove from list (even if now empty)           
00531               _compResList_size[ievent]--;//<-- Decrement size!
00532               
00533             }
00534             
00535             //-->Insert current guy in the right spot to keep list sorted
00536             _compResList[ievent]->InsertSorted(pResult);
00537             _compResList_size[ievent]++;//<-- Increment size!
00538             _compResList_smallestDeltalnL[ievent] = _compResList[ievent]->LastDeltalnL(); //<-- call and hold this value here instead of calling function on every event
00539           }//saving to ComparisonResultList
00540           
00541           delete pResult;
00542 
00543         }//not NULL comparison            
00544 
00545       }//precuts
00546       
00547     }//input loop 
00548     
00549     delete ci_lib;
00550 
00551   }//lib loop
00552   
00553   cout << "Done!" << endl;
00554 
00555 }//end of MakeComparison

bool MCNNRunner::NextLibraryEvent (  )  [private]

Definition at line 271 of file MCNNRunner.cxx.

References _files, file_count, MinosCompactEvent::FillAllStrips(), lib_chain, pcce, and srCtr.

Referenced by MakeComparison().

00271                                  {
00272 
00273   if(lib_chain==NULL || !lib_chain->GetEntry(srCtr)){
00274     if(file_count<_files.size()){
00275       delete lib_chain;
00276       lib_chain = new TChain("ccetree");
00277       Int_t filenum = lib_chain->Add(_files[file_count].c_str()); 
00278       cout << "Reading " << filenum << " library files: " << _files[file_count] << endl;
00279       lib_chain->SetBranchAddress("cce",&pcce);
00280       srCtr=0;
00281       ++file_count; 
00282     } else {
00283       return false;
00284     }
00285   }
00286   if(lib_chain->GetEntry(srCtr)){
00287     // Event is stored on disk without AllStrips member being filled
00288     // Ensure it is filled here.
00289     pcce->FillAllStrips();
00290  
00291     ++srCtr;    
00292     return true;
00293   } else {
00294     return false;
00295   }
00296 
00297 }//Next Library Event

Bool_t MCNNRunner::PassesMCNNPrecuts ( const NtpStRecord record,
const int  eventno 
) const [private]

Definition at line 304 of file MCNNRunner.cxx.

References NtpSRPlane::beg, det, MuELoss::e, NtpSRPlane::end, NtpStRecord::evt, SntpHelpers::GetPrimaryTrack(), isMC, kLoosePrecuts, SimFlag::kMC, kNoPrecuts, kTightPrecuts, NtpSRStripPulseHeight::mip, NueConvention::NueEnergyCorrection(), NtpSREvent::ph, NtpSRTrack::plane, and Base::release().

Referenced by CompactInput().

00304                                                                                        {
00305 
00306   const NtpSREvent* event = dynamic_cast<const NtpSREvent*>(record->evt->At(eventno));
00307   //don't even bother if event == 0
00308   if (!event) return kFALSE;
00309 
00310   const NtpSRTrack* track = dynamic_cast<const NtpSRTrack*>(SntpHelpers::GetPrimaryTrack(eventno, const_cast<NtpStRecord*>(record)));
00311   //const NtpSRTrack* track = dynamic_cast<const NtpSRTrack*>(record->trk->At(eventno));
00312 
00313   Detector::Detector_t det = record->GetHeader().GetVldContext().GetDetector();
00314   SimFlag::SimFlag_t   sim = record->GetHeader().GetVldContext().GetSimFlag();
00315   bool isMC = (sim == SimFlag::kMC);
00316   int release = record->GetRelease();
00317 
00318   Int_t trackplanes = (track)?TMath::Abs(track->plane.end - track->plane.beg):0;
00319   //Int_t trklikeplanes = (track)?track->plane.ntrklike:0;
00320 
00321   //unused//float x = event->vtx.x;
00322   //unused//float y = event->vtx.y;
00323   //unused//float z = event->vtx.z;
00324   float e;
00325   if (det==4) e = 4.0; // for caldet, always pass HACKY!
00326   else e = NueConvention::NueEnergyCorrection(event->ph.mip,release,isMC,det,false); //Otherwise, do the correction
00327   Bool_t inFid = kTRUE;
00328   //Comment it out so no fiducial cut in FD
00329   //if (det == Detector::kFar ) inFid = (NueConvention::IsInsideFarFiducial_Nue_Standard (x,y,z,isMC)==1);
00330   //For now, no fid cut in the near detector (until we work out the vertex correction that's present in NueAna...)
00331   //if (det == Detector::kNear) inFid = (NueConvention::IsInsideNearFiducial_Nue_Extended(x,y,z)==1);
00332 
00333   switch (MCNNPrecutLevel) {
00334   case kNoPrecuts:
00335     break;
00336   case kLoosePrecuts:
00337     if (!(inFid&&
00338           e>0.5&&
00339           e<12&&
00340           trackplanes<30))
00341       return kFALSE;
00342     break;
00343   case kTightPrecuts:
00344     if (!(inFid&&
00345           e>1&&
00346           e<8&&
00347           trackplanes<25))
00348       return kFALSE;
00349     break;
00350   default:
00351     break;  
00352   }  
00353 
00354   return kTRUE;
00355 }

void MCNNRunner::ReadEventLibrary (  )  [private]

Definition at line 240 of file MCNNRunner.cxx.

References _files, gSystem(), and infile.

Referenced by Run().

00240                                  {
00241 
00242   cout << "*** ReadEventLibrary() ***" << endl;
00243 
00244   //--> Read in the list of files from library.filelist
00245   const string fileName= "library.filelist";
00246   ifstream infile(fileName.c_str());
00247   if(!infile){
00248     cerr << "Can't open MC file " << fileName.c_str() << endl;
00249     return;
00250   }
00251   string line;
00252   while( getline(infile,line,'\n')){
00253     if(line[ 0 ] != 'C'){
00254       cout << "Adding file : " << line <<endl;
00255       // handle environment variables here...
00256       char *expanded_line = gSystem->ExpandPathName(line.c_str());
00257       string line_str = expanded_line;
00258       _files.push_back(line_str);
00259       delete expanded_line;
00260     }
00261   }
00262 
00263   cout << "The files array has size " << _files.size() << endl;
00264 
00265 }//ReadEventLibrary

void MCNNRunner::Run ( const char *  fname,
Int_t  entry_first,
Int_t  entry_last,
Int_t  piece_in,
unsigned short  qtype 
)

Definition at line 163 of file MCNNRunner.cxx.

References CompactInput(), Finish(), Initialize(), input_first, input_last, MakeComparison(), piece, ReadEventLibrary(), and WriteResults().

00163                                                                                                                 {
00164 
00165   //-->Init
00166   input_first=entry_first;
00167   input_last=entry_last;
00168   piece=piece_in;
00169   Initialize(qtype);
00170 
00171   //-->Library
00172   ReadEventLibrary();
00173 
00174   //-->Input events 
00175   CompactInput(fname,qtype);
00176 
00177   //-->Compare input and libraries
00178   MakeComparison();
00179 
00180   //--->Write out results
00181   WriteResults(fname);
00182 
00183   //-->Tidy up
00184   Finish();
00185   
00186 }

void MCNNRunner::Run ( const char *  fname,
unsigned short  qtype 
)

Definition at line 116 of file MCNNRunner.cxx.

References CompactInput(), Finish(), Initialize(), MakeComparison(), ReadEventLibrary(), and WriteResults().

00116                                                            {
00117 
00118   //-->Init
00119   Initialize(qtype);
00120 
00121   //-->Library
00122   ReadEventLibrary();
00123 
00124   //-->Input events 
00125   CompactInput(fname,qtype);
00126 
00127   //-->Compare input and libraries
00128   MakeComparison();
00129 
00130   //--->Write out results
00131   WriteResults(fname);
00132 
00133   //-->Tidy up
00134   Finish();
00135   
00136 }

void MCNNRunner::Run ( const char *  fname,
const char *  tag,
Int_t  entry_first,
Int_t  entry_last,
Int_t  piece_in,
unsigned short  qtype 
)

Definition at line 138 of file MCNNRunner.cxx.

References CompactInput(), Finish(), Initialize(), input_first, input_last, MakeComparison(), piece, ReadEventLibrary(), and WriteResults().

00138                                                                                                                                 { //<--obsolete
00139 
00140   //-->Init
00141   input_first=entry_first;
00142   input_last=entry_last;
00143   piece=piece_in;
00144   Initialize(qtype);
00145 
00146   //-->Library
00147   ReadEventLibrary();
00148 
00149   //-->Input events 
00150   CompactInput(fname,qtype);
00151 
00152   //-->Compare input and libraries
00153   MakeComparison();
00154 
00155   //--->Write out results
00156   WriteResults(fname,tag);
00157 
00158   //-->Tidy up
00159   Finish();
00160   
00161 }

void MCNNRunner::Run ( const char *  fname,
const char *  tag,
unsigned short  qtype 
)

Definition at line 94 of file MCNNRunner.cxx.

References CompactInput(), Finish(), Initialize(), MakeComparison(), ReadEventLibrary(), and WriteResults().

00094                                                                             { //<--obsolete
00095 
00096   //-->Init
00097   Initialize(qtype);
00098 
00099   //-->Library
00100   ReadEventLibrary();
00101 
00102   //-->Input events 
00103   CompactInput(fname,qtype);
00104 
00105   //-->Compare input and libraries
00106   MakeComparison();
00107 
00108   //--->Write out results
00109   WriteResults(fname,tag);
00110 
00111   //-->Tidy up
00112   Finish();
00113   
00114 }

void MCNNRunner::SetMCNNPrecutLevel ( int  level  )  [inline]

Definition at line 52 of file MCNNRunner.h.

00052 { MCNNPrecutLevel = level; }

void MCNNRunner::WriteResults ( const char *  fname  )  [private]

Definition at line 561 of file MCNNRunner.cxx.

References _compResList_untrimmed, _inputAll_untrimmed, atleastonelibevent, DataPreselected(), MuELoss::e, NtpMCTruth::emfrac, NtpStRecord::evthdr, NtpTools::FillRecoEInfo(), NtpMCTruth::flux, NtpTools::GetEvent(), RecRecordImp< T >::GetHeader(), RecDataHeader::GetRun(), RecPhysicsHeader::GetSnarl(), RecDataHeader::GetSubRun(), NtpTools::GetTotHadPt(), NtpTools::GetTruth(), gSystem(), NtpMCTruth::iaction, input_first, input_last, NtpMCTruth::inu, NtpMCTruth::inunoosc, NtpMCTruth::iresonance, library_event_count, MCLibraryPreselected(), NtpSRPlane::n, NtpSREventSummary::nevent, NtpSREvent::nstrip, NtpSRPlane::nu, NtpSRPlane::nv, NtpMCTruth::p4neu, NtpMCTruth::p4neunoosc, piece, NtpSREvent::plane, RecoE::Reset(), MinosAnalysisResult::ResultList, RecoE::totalE, NtpMCFluxInfo::tptype, NtpMCFluxInfo::tpx, NtpMCFluxInfo::tpy, NtpMCFluxInfo::tpz, NtpSRVertex::u, NtpSRVertex::v, NtpSREvent::vtx, NtpMCTruth::vtxx, NtpMCTruth::vtxy, NtpMCTruth::vtxz, NtpMCTruth::w2, NtpSRVertex::x, NtpSRVertex::y, NtpMCTruth::y, and NtpSRVertex::z.

00561                                               {
00562 
00563   cout << "*** WriteResults ***" << endl;
00564   cout << "Going over input file again to write out results" << endl;
00565   cout << "LIBRARY EVENTS USED: " << library_event_count << endl;
00566   cout << "(You should always sanity-check this number!)" << endl;
00567 
00568   if(atleastonelibevent==true){
00569 
00570     Int_t lastrun=0;
00571     Int_t evtcont=-1;//needs to be -1 so when increased after ievt loop get 0
00572     
00573     //-->Output file and tree variables
00574     TFile *OutputFile = NULL;
00575     TTree *OutputTree = NULL;
00576     TTree *OutputTreePOT = NULL;
00577     MinosCompactEvent* pcomptevt = NULL;
00578     MinosAnalysisResult* OutputResult = NULL;
00579     int   OutputRun = 0;
00580     int   OutputSnarl = 0;
00581     int   OutputEvent = 0;
00582     int   OutputNuId = 0 ;
00583     int   OutputNuIdNoOsc = 0;
00584     int   OutputNuAction = 0 ;
00585     float OutputNuE = 0;
00586     float OutputNuENoOsc = 0;
00587     float OutputY   = 0;
00588     float OutputEMFrac   = 0;
00589     int OutputIdRes = 0;
00590     
00591     float OutputQtot    = 0;
00592     float OutputVtxX    = 0;
00593     float OutputVtxY    = 0;
00594     float OutputVtxU    = 0;
00595     float OutputVtxV    = 0;
00596     float OutputVtxZ    = 0;
00597     float OutputTVtxX   = 0;
00598     float OutputTVtxY   = 0;
00599     float OutputTVtxZ   = 0;
00600     float Outputtpx = 0 ;
00601     float Outputtpy = 0;
00602     float Outputtpz = 0;
00603     int Outputtptype = 0;
00604     int   OutputNPln    = 0;
00605     int   OutputNPlnU    = 0;
00606     int   OutputNPlnV    = 0;
00607     int   OutputNStp    = 0;
00608     int OutputMCPresel = 0;
00609     int OutputDataPresel = 0;
00610     int OutputXTalk = 0;
00611     int OutputXTalkTagged = 0;
00612     int OutputXTalkMisTagged = 0;
00613     int OutputPhysics = 0;
00614     float OutputW2 = 0;
00615     float OutputTotPt = 0;
00616     
00617     float OutputRecoE   = 0;
00618     
00619     float snarl_pot = 0;
00620     int good_snarl = 0;//1=good snarl;0=bad snarl (beam wise)
00621     float total_pot = 0;
00622     float good_pot = 0;
00623     
00624     //-->Opening input file
00625     //NtpFile* input  = new NtpFile(isMC,isMRCC);
00626     TChain *chain = new TChain("NtpSt");//new
00627     cout << "Adding INPUT file to list: " << fname << endl;
00628     //input->AddFiles(fname);
00629     chain->Add(fname);
00630     
00631     const NtpStRecord *record = 0;
00632     chain->SetBranchAddress("NtpStRecord",&record);
00633     
00634     //Get first subrun
00635     Int_t firstsubrun=0;
00636     if(chain->GetEntry(0)){
00637       firstsubrun=record->GetHeader().GetSubRun();
00638     }
00639     
00640     //while(input->GetNextRecord()){
00641     Int_t srCtr_local=input_first;//new
00642     while(chain->GetEntry(srCtr_local) && srCtr_local<=input_last){//new
00643       ++srCtr_local;
00644       
00645       //POT counting
00646       //const NtpBDLiteRecord* bdrecord  = input->GetBDRecord();
00647       
00648       good_snarl=0;
00649       static float pot = 0;
00650       /*
00651         if(bdrecord!=NULL){
00652         
00653         pot = 0;
00654         if(NtpTools::PassBeamCuts(NtpTools::kLE10, bdrecord, pot, isMC)){
00655         total_pot+=pot;
00656         good_pot+=pot;
00657         good_snarl=1;
00658         }else{
00659         total_pot+=pot;
00660         //continue;//<--uncomment if only want to save good snarls
00661         }
00662         //printf(" pot: %f sum:%f / %f       \n", pot, good_pot, total_pot);
00663         }else{
00664         cout << "no beam record for this snarl" <<endl;
00665         }//<--pot counting
00666       */
00667       snarl_pot=pot;
00668       
00669       //const NtpStRecord* record = input->GetCCRecord(); 
00670       
00671       //-->file handling
00672       if(record->GetHeader().GetRun()!=lastrun){
00673         // Close last output file
00674         if(lastrun!=0){
00675           OutputTree->AutoSave();
00676           OutputTreePOT->AutoSave();
00677           delete OutputFile;
00678         }
00679         //Create the output file and trees
00680         // This is ugly (small memory leak in recreating _ptr s)
00681         OutputResult = new MinosAnalysisResult();
00682         lastrun = record->GetHeader().GetRun();
00683         
00684         //Run and subrun
00685         ostringstream e;
00686         string filenamestr;
00687         filenamestr=filenamestr+fname;
00688         string filenopath = filenamestr.substr(filenamestr.find_last_of("/")+1,
00689                                                filenamestr.find_last_of(".root")-
00690                                                filenamestr.find_last_of("/"));
00691         
00692         // hardcoding $MCNNTMP as a hack
00693         if(piece==-1){
00694           
00695           e << "$MCNNTMP/mcnn_" << filenopath;
00696           
00697         } else {
00698           
00699           e << "$MCNNTMP/mcnn_" << piece << "_" << filenopath;
00700           
00701         }
00702         
00703         cout << " Opening output file for file : " << filenopath << endl;
00704         
00705         string outputfile = gSystem->ExpandPathName((e.str()).c_str());
00706         cout << " Writing : " << outputfile << endl;
00707         OutputFile = new TFile(outputfile.c_str(),"recreate");
00708         OutputTree = new TTree("nn","Minos NuE Analysis Results");
00709         OutputTreePOT = new TTree("pottree","MCNN pot");
00710         OutputTree->Branch("cce","MinosCompactEvent",&pcomptevt);
00711         OutputTree->Branch("comparisonResults", "MinosAnalysisResult", &OutputResult);
00712         OutputTree->Branch("run", &OutputRun, "run/I");
00713         OutputTree->Branch("snarl", &OutputSnarl, "snarl/I");
00714         OutputTree->Branch("evt", &OutputEvent, "evt/I");
00715         OutputTree->Branch("nuid", &OutputNuId, "nuid/I");
00716         OutputTree->Branch("nuidnoosc",&OutputNuIdNoOsc,"nuidnoosc/I");
00717         OutputTree->Branch("action", &OutputNuAction, "action/I");
00718         OutputTree->Branch("nue", &OutputNuE, "nue/F");
00719         OutputTree->Branch("nuenoosc",&OutputNuENoOsc,"nuenoosc/F");
00720         OutputTree->Branch("reco_nue",&OutputRecoE,"reco_nue/F");
00721         OutputTree->Branch("y", &OutputY, "y/F");
00722         OutputTree->Branch("emfrac", &OutputEMFrac, "emfrac/F");
00723         OutputTree->Branch("ires",&OutputIdRes,"ires/I");
00724         OutputTree->Branch("qtot", &OutputQtot, "qtot/F");
00725         OutputTree->Branch("vtxx", &OutputVtxX, "vtxx/F");
00726         OutputTree->Branch("vtxy", &OutputVtxY, "vtxy/F");
00727         OutputTree->Branch("vtxz", &OutputVtxZ, "vtxz/F");
00728         OutputTree->Branch("vtxu", &OutputVtxU, "vtxu/F");
00729         OutputTree->Branch("vtxv", &OutputVtxV, "vtxv/F");
00730         OutputTree->Branch("tvtxx", &OutputTVtxX, "tvtxx/F");
00731         OutputTree->Branch("tvtxy", &OutputTVtxY, "tvtxy/F");
00732         OutputTree->Branch("tvtxz", &OutputTVtxZ, "tvtxz/F");
00733         OutputTree->Branch("tptype",&Outputtptype,"tptype/I");
00734         OutputTree->Branch("tpx",&Outputtpx,"tpx/F");
00735         OutputTree->Branch("tpy",&Outputtpy,"tpy/F");
00736         OutputTree->Branch("tpz",&Outputtpz,"tpz/F");
00737         OutputTree->Branch("npln", &OutputNPln, "npln/I");
00738         OutputTree->Branch("nstp", &OutputNStp, "nstp/I");
00739         OutputTree->Branch("nplnu", &OutputNPlnU, "nplnu/I");
00740         OutputTree->Branch("nplnv", &OutputNPlnV, "nplnv/I");     
00741         OutputTree->Branch("mcpresel",&OutputMCPresel,"mcpresel/I");
00742         OutputTree->Branch("datapresel",&OutputDataPresel,"datapresel/I");
00743         OutputTree->Branch("nxtalk",&OutputXTalk,"nxtalk/I");
00744         OutputTree->Branch("nxtalk_tagged",&OutputXTalkTagged,"nxtalk_tagged/I");
00745         OutputTree->Branch("nxtalk_mistagged",&OutputXTalkMisTagged,"nxtalk_mistagged/I"); 
00746         OutputTree->Branch("nphysics",&OutputPhysics,"nphysics/I");
00747         OutputTree->Branch("w2",&OutputW2,"w2/F");
00748         OutputTree->Branch("totpt",&OutputTotPt,"totpt/F");
00749         OutputTree->Branch("snarl_pot",&snarl_pot,"snarl_pot/F");
00750         OutputTree->Branch("good_snarl",&good_snarl,"good_snarl/I");
00751         OutputTreePOT->Branch("total_pot",&total_pot,"total_pot/F");
00752         OutputTreePOT->Branch("good_pot",&good_pot,"good_pot/F");
00753         OutputTree->SetDirectory(OutputFile);
00754         OutputTreePOT->SetDirectory(OutputFile);
00755         
00756       }//file handling
00757       
00758       for(int ievt=0;ievt<record->evthdr.nevent;++ievt){
00759         
00760         ++evtcont;
00761         
00762         const NtpSREvent* event = NtpTools::GetEvent(record, ievt);
00763         const NtpMCTruth* truth = NtpTools::GetTruth(record, ievt);
00764         
00765         
00766         //-->Fill MinosAnalysisResult for this input event (kind of ugly code this is)
00767         list<ComparisonResult>::iterator iter;
00768         list<ComparisonResult>::iterator iter_end;
00769         iter     = _compResList_untrimmed[evtcont]->compResultList.begin();
00770         iter_end = _compResList_untrimmed[evtcont]->compResultList.end();
00771         OutputResult = new MinosAnalysisResult();
00772         pcomptevt = new MinosCompactEvent(_inputAll_untrimmed[evtcont]);
00773         TClonesArray& resultList = *(OutputResult->ResultList);
00774         int i=0;
00775         while(iter!=iter_end){
00776           new(resultList[i]) ComparisonResult( &(*iter) );
00777           iter++;
00778           i++;
00779         }
00780         
00781         //-->Other variables from input file
00782         OutputRun = record->GetHeader().GetRun();
00783         OutputSnarl = record->GetHeader().GetSnarl();
00784         OutputEvent = ievt;
00785         if(truth!=0){
00786           OutputNuId = truth->inu;
00787           OutputNuIdNoOsc = truth->inunoosc;
00788           OutputNuAction  = truth->iaction;
00789           OutputNuE = truth->p4neu[3];
00790           OutputNuENoOsc = truth->p4neunoosc[3];
00791           OutputY = truth->y;   
00792           OutputEMFrac = truth->emfrac; 
00793           OutputIdRes = truth->iresonance;
00794           OutputTVtxX = truth->vtxx;
00795           OutputTVtxY = truth->vtxy;
00796           OutputTVtxZ = truth->vtxz;
00797           Outputtptype = truth->flux.tptype;
00798           Outputtpx = truth->flux.tpx;
00799           Outputtpy = truth->flux.tpy;
00800           Outputtpz = truth->flux.tpz;
00801         }
00802 
00803         //protect against null event
00804         if (event != 0) {
00805           OutputNPln = event->plane.n;
00806           OutputQtot = _inputAll_untrimmed[evtcont]->Qtot;
00807           OutputVtxX = event->vtx.x;
00808           OutputVtxY = event->vtx.y;
00809           OutputVtxZ = event->vtx.z;
00810           OutputVtxU = event->vtx.u;
00811           OutputVtxV = event->vtx.v;
00812           OutputNPlnU = event->plane.nu;
00813           OutputNPlnV = event->plane.nv;
00814           OutputNStp = event->nstrip;
00815         } else {
00816           OutputNPln = 0;
00817           OutputQtot = 0;
00818           OutputVtxX = 0;
00819           OutputVtxY = 0;
00820           OutputVtxZ = 0;
00821           OutputVtxU = 0;
00822           OutputVtxV = 0;
00823           OutputNPlnU = 0;
00824           OutputNPlnV = 0;
00825           OutputNStp = 0;
00826         }
00827         
00828         OutputXTalk = _inputAll_untrimmed[evtcont]->nxtalk;
00829         OutputXTalkTagged = _inputAll_untrimmed[evtcont]->nxtalk_tagged;
00830         OutputXTalkMisTagged = _inputAll_untrimmed[evtcont]->nxtalk_mistagged;
00831         OutputPhysics = _inputAll_untrimmed[evtcont]->nphysics;
00832 
00833         if(truth!=0){
00834           OutputW2 = truth->w2;
00835           OutputTotPt = NtpTools::GetTotHadPt(record,truth);
00836         } else {
00837           OutputW2 = -1;
00838           OutputTotPt = -1;
00839         }
00840 
00841         static RecoE* recoe = new RecoE();
00842         recoe->Reset(); 
00843         //protect against null event
00844         if (event != 0) {
00845           if(!NtpTools::FillRecoEInfo(record, ievt, recoe)){
00846             continue;
00847           }
00848         }
00849         OutputRecoE=recoe->totalE;
00850 
00851         OutputMCPresel=0;
00852         //protect against null event
00853         if (event != 0) {
00854           if(MCLibraryPreselected(record,ievt)){
00855             OutputMCPresel=1;
00856           }
00857         }
00858 
00859         OutputDataPresel=0;
00860         //protect against null event
00861         if (event != 0) {
00862           if(DataPreselected(event)){
00863             OutputDataPresel=1;
00864           }
00865         }
00866         
00867         //-->fill tree
00868         OutputTree->Fill();
00869 
00870         (OutputResult->ResultList)->Delete();
00871         
00872       }//evt loop
00873       
00874       if(record->evthdr.nevent==0){//<-- an entry must still be recorded for empty snarls (otherwise cannot match with NueAna trees)
00875         
00876         OutputRun = record->GetHeader().GetRun();
00877         OutputSnarl = record->GetHeader().GetSnarl();
00878         OutputEvent = -1;
00879         
00880         OutputNuId = 0 ;
00881         OutputNuIdNoOsc = 0;
00882         OutputNuAction = 0 ;
00883         OutputNuE = 0;
00884         OutputNuENoOsc = 0;
00885         OutputY   = 0;
00886         OutputEMFrac   = 0;
00887         OutputIdRes = 0;
00888         
00889         OutputQtot    = 0;
00890         OutputVtxX    = 0;
00891         OutputVtxY    = 0;
00892         OutputVtxU    = 0;
00893         OutputVtxV    = 0;
00894         OutputVtxZ    = 0;
00895         OutputTVtxX   = 0;
00896         OutputTVtxY   = 0;
00897         OutputTVtxZ   = 0;
00898         Outputtpx = 0 ;
00899         Outputtpy = 0;
00900         Outputtpz = 0;
00901         Outputtptype = 0;
00902         OutputNPln    = 0;
00903         OutputNPlnU    = 0;
00904         OutputNPlnV    = 0;
00905         OutputNStp    = 0;
00906         OutputMCPresel = 0;
00907         OutputDataPresel = 0;
00908         OutputXTalk = 0;
00909         OutputXTalkTagged = 0;
00910         OutputXTalkMisTagged = 0;
00911         OutputPhysics = 0;
00912         OutputW2 = 0;
00913         OutputTotPt = 0;
00914         
00915         OutputRecoE   = 0;
00916         
00917         OutputTree->Fill();
00918       }//in case of empty snarl (0 events)
00919 
00920     }//record loop
00921     
00922     OutputTreePOT->Fill();
00923     
00924     cout << " Closing the output file " << endl;
00925     OutputFile->Write();
00926     OutputFile->Close();  
00927     return;  
00928     cout << "Leaving WriteResults()" << endl;
00929     
00930     delete chain;
00931 
00932   } else {
00933     cout << "CAUTION: Will not write file as libraries were not found/read" << endl;
00934   }
00935 
00936 }//end of WriteResults

void MCNNRunner::WriteResults ( const char *  fname,
const char *  tag 
) [private]

Definition at line 942 of file MCNNRunner.cxx.

References _compResList_untrimmed, _inputAll_untrimmed, DataPreselected(), digits(), MuELoss::e, NtpMCTruth::emfrac, NtpStRecord::evthdr, NtpTools::FillRecoEInfo(), NtpMCTruth::flux, VldContext::GetDetector(), NtpTools::GetEvent(), RecRecordImp< T >::GetHeader(), RecDataHeader::GetRun(), VldContext::GetSimFlag(), RecPhysicsHeader::GetSnarl(), RecDataHeader::GetSubRun(), NtpTools::GetTotHadPt(), NtpTools::GetTruth(), RecHeader::GetVldContext(), gSystem(), NtpMCTruth::iaction, input_first, input_last, NtpMCTruth::inu, NtpMCTruth::inunoosc, NtpMCTruth::iresonance, SimFlag::kData, Detector::kFar, MCLibraryPreselected(), NtpSRPlane::n, NtpSREventSummary::nevent, NtpSREvent::nstrip, NtpSRPlane::nu, NtpSRPlane::nv, NtpMCTruth::p4neu, NtpMCTruth::p4neunoosc, piece, NtpSREvent::plane, RecoE::Reset(), MinosAnalysisResult::ResultList, RecoE::totalE, NtpMCFluxInfo::tptype, NtpMCFluxInfo::tpx, NtpMCFluxInfo::tpy, NtpMCFluxInfo::tpz, NtpSRVertex::u, NtpSRVertex::v, NtpSREvent::vtx, NtpMCTruth::vtxx, NtpMCTruth::vtxy, NtpMCTruth::vtxz, NtpMCTruth::w2, NtpSRVertex::x, NtpSRVertex::y, NtpMCTruth::y, and NtpSRVertex::z.

Referenced by Run().

00942                                                                {
00943   
00944   cout << "*** WriteResults ***" << endl;
00945   cout << "Going over input file again to write out results" << endl;
00946 
00947   Int_t lastrun=0;
00948   Int_t evtcont=-1;//needs to be -1 so when increased after ievt loop get 0
00949 
00950   //-->Output file and tree variables
00951   TFile *OutputFile = NULL;
00952   TTree *OutputTree = NULL;
00953   TTree *OutputTreePOT = NULL;
00954   MinosCompactEvent* pcomptevt = NULL;
00955   MinosAnalysisResult* OutputResult = NULL;
00956   int   OutputRun = 0;
00957   int   OutputSnarl = 0;
00958   int   OutputEvent = 0;
00959   int   OutputNuId = 0 ;
00960   int   OutputNuIdNoOsc = 0;
00961   int   OutputNuAction = 0 ;
00962   float OutputNuE = 0;
00963   float OutputNuENoOsc = 0;
00964   float OutputY   = 0;
00965   float OutputEMFrac   = 0;
00966   int OutputIdRes = 0;
00967 
00968   float OutputQtot    = 0;
00969   float OutputVtxX    = 0;
00970   float OutputVtxY    = 0;
00971   float OutputVtxU    = 0;
00972   float OutputVtxV    = 0;
00973   float OutputVtxZ    = 0;
00974   float OutputTVtxX   = 0;
00975   float OutputTVtxY   = 0;
00976   float OutputTVtxZ   = 0;
00977   float Outputtpx = 0 ;
00978   float Outputtpy = 0;
00979   float Outputtpz = 0;
00980   int Outputtptype = 0;
00981   int   OutputNPln    = 0;
00982   int   OutputNPlnU    = 0;
00983   int   OutputNPlnV    = 0;
00984   int   OutputNStp    = 0;
00985   int OutputMCPresel = 0;
00986   int OutputDataPresel = 0;
00987   int OutputXTalk = 0;
00988   int OutputXTalkTagged = 0;
00989   int OutputXTalkMisTagged = 0;
00990   int OutputPhysics = 0;
00991   float OutputW2 = 0;
00992   float OutputTotPt = 0;
00993     
00994   float OutputRecoE   = 0;
00995   
00996   float snarl_pot = 0;
00997   int good_snarl = 0;//1=good snarl;0=bad snarl (beam wise)
00998   float total_pot = 0;
00999   float good_pot = 0;
01000   
01001   //-->Opening input file
01002   //NtpFile* input  = new NtpFile(isMC,isMRCC);
01003   TChain *chain = new TChain("NtpSt");//new
01004   cout << "Adding INPUT file to list: " << fname << endl;
01005   //input->AddFiles(fname);
01006   chain->Add(fname);
01007 
01008   const NtpStRecord *record = 0;
01009   chain->SetBranchAddress("NtpStRecord",&record);
01010   
01011   //Get first subrun
01012   Int_t firstsubrun=0;
01013   if(chain->GetEntry(0)){
01014     firstsubrun=record->GetHeader().GetSubRun();
01015   }
01016 
01017   //while(input->GetNextRecord()){
01018   Int_t srCtr_local=input_first;//new
01019   while(chain->GetEntry(srCtr_local) && srCtr_local<=input_last){//new
01020     ++srCtr_local;
01021 
01022     //POT counting
01023     //const NtpBDLiteRecord* bdrecord  = input->GetBDRecord();
01024 
01025     good_snarl=0;
01026     static float pot = 0;
01027     /*
01028     if(bdrecord!=NULL){
01029       
01030       pot = 0;
01031       if(NtpTools::PassBeamCuts(NtpTools::kLE10, bdrecord, pot, isMC)){
01032         total_pot+=pot;
01033         good_pot+=pot;
01034         good_snarl=1;
01035       }else{
01036         total_pot+=pot;
01037         //continue;//<--uncomment if only want to save good snarls
01038       }
01039       //printf(" pot: %f sum:%f / %f       \n", pot, good_pot, total_pot);
01040     }else{
01041       cout << "no beam record for this snarl" <<endl;
01042     }//<--pot counting
01043     */
01044     snarl_pot=pot;
01045 
01046     //const NtpStRecord* record = input->GetCCRecord(); 
01047 
01048     //-->file handling
01049     if(record->GetHeader().GetRun()!=lastrun){
01050       // Close last output file
01051       if(lastrun!=0){
01052         OutputTree->AutoSave();
01053         OutputTreePOT->AutoSave();
01054         delete OutputFile;
01055       }
01056       //Create the output file and trees
01057       // This is ugly (small memory leak in recreating _ptr s)
01058       OutputResult = new MinosAnalysisResult();
01059       lastrun = record->GetHeader().GetRun();
01060       cout << " Opening output file for run : " << record->GetHeader().GetRun();
01061 
01062       //Run and subrun
01063       ostringstream e;
01064       Int_t digits=0;
01065       
01066       //-->run
01067       std::stringstream runstr;
01068       Int_t larun=record->GetHeader().GetRun();
01069       if(larun>0){
01070         digits=(int)log10((float)larun) + 1;
01071       }
01072       if(digits==0){
01073         runstr << "00000000" << larun;
01074       } else if(digits==1){
01075         runstr << "0000000" << larun;
01076       } else if(digits==2){
01077         runstr << "000000" << larun;
01078       } else if(digits==3){
01079         runstr << "00000" << larun;
01080       } else if(digits==4){
01081         runstr << "0000" << larun;
01082       } else if(digits==5){
01083         runstr << "000" << larun;
01084       } else if(digits==6){
01085         runstr << "00" << larun;
01086       } else if(digits==7){
01087         runstr << "0" << larun;
01088       } else if(digits==8){
01089         runstr << larun;
01090       }   
01091       
01092       //-->subrun
01093       std::stringstream subrunstr;     
01094       digits=0;
01095       if(firstsubrun>0){
01096         digits=(int)log10((float)firstsubrun) + 1;
01097       }
01098       if(digits==0){
01099         subrunstr << "0000";
01100       } 
01101       else if(digits==1){
01102         subrunstr << "000" << firstsubrun;
01103       }
01104       else if(digits==2){
01105         subrunstr << "00" << firstsubrun;
01106       }
01107       else if(digits==3){
01108         subrunstr << "0" << firstsubrun;
01109       } 
01110       else if(digits==4){
01111         subrunstr << firstsubrun;
01112       }
01113  
01114       //Data or MC?
01115       std::stringstream whatletter;
01116       if(record->GetHeader().GetVldContext().GetSimFlag()==SimFlag::kData){
01117         if(record->GetHeader().GetVldContext().GetDetector()==Detector::kFar){
01118           whatletter << "_F";
01119         } else {
01120           whatletter << "_N";
01121         }
01122       } else {
01123         if(record->GetHeader().GetVldContext().GetDetector()==Detector::kFar){
01124           whatletter << "_f";
01125         } else {
01126           whatletter << "_n";
01127         }
01128       }
01129 
01130       // hardcoding $MCNNTMP as a hack
01131       if(piece==-1){
01132         
01133         e << "$MCNNTMP/mcnn" << whatletter.str() << runstr.str() << "_" << subrunstr.str() << tag;
01134         
01135       } else {
01136         
01137         e << "$MCNNTMP/mcnn_" << piece << whatletter.str() << runstr.str() << "_" << subrunstr.str() << tag;
01138 
01139       }
01140       
01141       string outputfile = e.str();
01142       cout << " Writing : " << outputfile << endl;
01143       OutputFile = new TFile(gSystem->ExpandPathName(outputfile.c_str()),"recreate");
01144       OutputTree = new TTree("nn","Minos NuE Analysis Results");
01145       OutputTreePOT = new TTree("pottree","MCNN pot");
01146       OutputTree->Branch("cce","MinosCompactEvent",&pcomptevt);
01147       OutputTree->Branch("comparisonResults", "MinosAnalysisResult", &OutputResult);
01148       OutputTree->Branch("run", &OutputRun, "run/I");
01149       OutputTree->Branch("snarl", &OutputSnarl, "snarl/I");
01150       OutputTree->Branch("evt", &OutputEvent, "evt/I");
01151       OutputTree->Branch("nuid", &OutputNuId, "nuid/I");
01152       OutputTree->Branch("nuidnoosc",&OutputNuIdNoOsc,"nuidnoosc/I");
01153       OutputTree->Branch("action", &OutputNuAction, "action/I");
01154       OutputTree->Branch("nue", &OutputNuE, "nue/F");
01155       OutputTree->Branch("nuenoosc",&OutputNuENoOsc,"nuenoosc/F");
01156       OutputTree->Branch("reco_nue",&OutputRecoE,"reco_nue/F");
01157       OutputTree->Branch("y", &OutputY, "y/F");
01158       OutputTree->Branch("emfrac", &OutputEMFrac, "emfrac/F");
01159       OutputTree->Branch("ires",&OutputIdRes,"ires/I");
01160       OutputTree->Branch("qtot", &OutputQtot, "qtot/F");
01161       OutputTree->Branch("vtxx", &OutputVtxX, "vtxx/F");
01162       OutputTree->Branch("vtxy", &OutputVtxY, "vtxy/F");
01163       OutputTree->Branch("vtxz", &OutputVtxZ, "vtxz/F");
01164       OutputTree->Branch("vtxu", &OutputVtxU, "vtxu/F");
01165       OutputTree->Branch("vtxv", &OutputVtxV, "vtxv/F");
01166       OutputTree->Branch("tvtxx", &OutputTVtxX, "tvtxx/F");
01167       OutputTree->Branch("tvtxy", &OutputTVtxY, "tvtxy/F");
01168       OutputTree->Branch("tvtxz", &OutputTVtxZ, "tvtxz/F");
01169       OutputTree->Branch("tptype",&Outputtptype,"tptype/I");
01170       OutputTree->Branch("tpx",&Outputtpx,"tpx/F");
01171       OutputTree->Branch("tpy",&Outputtpy,"tpy/F");
01172       OutputTree->Branch("tpz",&Outputtpz,"tpz/F");
01173       OutputTree->Branch("npln", &OutputNPln, "npln/I");
01174       OutputTree->Branch("nstp", &OutputNStp, "nstp/I");
01175       OutputTree->Branch("nplnu", &OutputNPlnU, "nplnu/I");
01176       OutputTree->Branch("nplnv", &OutputNPlnV, "nplnv/I");       
01177       OutputTree->Branch("mcpresel",&OutputMCPresel,"mcpresel/I");
01178       OutputTree->Branch("datapresel",&OutputDataPresel,"datapresel/I");
01179       OutputTree->Branch("nxtalk",&OutputXTalk,"nxtalk/I");
01180       OutputTree->Branch("nxtalk_tagged",&OutputXTalkTagged,"nxtalk_tagged/I");
01181       OutputTree->Branch("nxtalk_mistagged",&OutputXTalkMisTagged,"nxtalk_mistagged/I"); 
01182       OutputTree->Branch("nphysics",&OutputPhysics,"nphysics/I");
01183       OutputTree->Branch("w2",&OutputW2,"w2/F");
01184       OutputTree->Branch("totpt",&OutputTotPt,"totpt/F");
01185       OutputTree->Branch("snarl_pot",&snarl_pot,"snarl_pot/F");
01186       OutputTree->Branch("good_snarl",&good_snarl,"good_snarl/I");
01187       OutputTreePOT->Branch("total_pot",&total_pot,"total_pot/F");
01188       OutputTreePOT->Branch("good_pot",&good_pot,"good_pot/F");
01189       OutputTree->SetDirectory(OutputFile);
01190       OutputTreePOT->SetDirectory(OutputFile);
01191       
01192     }//file handling
01193 
01194     for(int ievt=0;ievt<record->evthdr.nevent;++ievt){
01195 
01196       ++evtcont;
01197   
01198       const NtpSREvent* event = NtpTools::GetEvent(record, ievt);
01199       const NtpMCTruth* truth = NtpTools::GetTruth(record, ievt);
01200        
01201 
01202       //-->Fill MinosAnalysisResult for this input event (kind of ugly code this is)
01203       list<ComparisonResult>::iterator iter;
01204       list<ComparisonResult>::iterator iter_end;
01205       iter     = _compResList_untrimmed[evtcont]->compResultList.begin();
01206       iter_end = _compResList_untrimmed[evtcont]->compResultList.end();
01207       OutputResult = new MinosAnalysisResult();
01208       pcomptevt = new MinosCompactEvent(_inputAll_untrimmed[evtcont]);
01209       TClonesArray& resultList = *(OutputResult->ResultList);
01210       int i=0;
01211       while(iter!=iter_end){
01212         new(resultList[i]) ComparisonResult( &(*iter) );
01213         iter++;
01214         i++;
01215       }
01216 
01217       //-->Other variables from input file
01218       OutputRun = record->GetHeader().GetRun();
01219         OutputSnarl = record->GetHeader().GetSnarl();
01220         OutputEvent = ievt;
01221         if(truth!=0){
01222           OutputNuId = truth->inu;
01223           OutputNuIdNoOsc = truth->inunoosc;
01224           OutputNuAction  = truth->iaction;
01225           OutputNuE = truth->p4neu[3];
01226           OutputNuENoOsc = truth->p4neunoosc[3];
01227           OutputY = truth->y;   
01228           OutputEMFrac = truth->emfrac; 
01229           OutputIdRes = truth->iresonance;
01230           OutputTVtxX = truth->vtxx;
01231           OutputTVtxY = truth->vtxy;
01232           OutputTVtxZ = truth->vtxz;
01233           Outputtptype = truth->flux.tptype;
01234           Outputtpx = truth->flux.tpx;
01235           Outputtpy = truth->flux.tpy;
01236           Outputtpz = truth->flux.tpz;
01237         }
01238 
01239         OutputNPln = event->plane.n;
01240         OutputQtot = _inputAll_untrimmed[evtcont]->Qtot;
01241         OutputVtxX = event->vtx.x;
01242         OutputVtxY = event->vtx.y;
01243         OutputVtxZ = event->vtx.z;
01244         OutputVtxU = event->vtx.u;
01245         OutputVtxV = event->vtx.v;
01246         OutputNPlnU = event->plane.nu;
01247         OutputNPlnV = event->plane.nv;
01248         OutputNStp = event->nstrip;
01249 
01250         OutputXTalk = _inputAll_untrimmed[evtcont]->nxtalk;
01251         OutputXTalkTagged = _inputAll_untrimmed[evtcont]->nxtalk_tagged;
01252         OutputXTalkMisTagged = _inputAll_untrimmed[evtcont]->nxtalk_mistagged;
01253         OutputPhysics = _inputAll_untrimmed[evtcont]->nphysics;
01254 
01255         if(truth!=0){
01256           OutputW2 = truth->w2;
01257           OutputTotPt = NtpTools::GetTotHadPt(record,truth);
01258         } else {
01259           OutputW2 = -1;
01260           OutputTotPt = -1;
01261         }
01262 
01263         static RecoE* recoe = new RecoE();
01264         recoe->Reset(); 
01265         if(!NtpTools::FillRecoEInfo(record, ievt, recoe)){
01266           continue;
01267         }
01268         OutputRecoE=recoe->totalE;
01269 
01270         OutputMCPresel=0;
01271         if(MCLibraryPreselected(record,ievt)){
01272           OutputMCPresel=1;
01273         }
01274 
01275         OutputDataPresel=0;
01276         if(DataPreselected(event)){
01277           OutputDataPresel=1;
01278         }
01279         
01280         //-->fill tree
01281         OutputTree->Fill();
01282 
01283         (OutputResult->ResultList)->Delete();
01284 
01285     }//evt loop
01286 
01287     if(record->evthdr.nevent==0){//<-- an entry must still be recorded for empty snarls (otherwise cannot match with NueAna trees)
01288       
01289       OutputRun = record->GetHeader().GetRun();
01290       OutputSnarl = record->GetHeader().GetSnarl();
01291       OutputEvent = -1;
01292 
01293       OutputNuId = 0 ;
01294       OutputNuIdNoOsc = 0;
01295       OutputNuAction = 0 ;
01296       OutputNuE = 0;
01297       OutputNuENoOsc = 0;
01298       OutputY   = 0;
01299       OutputEMFrac   = 0;
01300       OutputIdRes = 0;
01301       
01302       OutputQtot    = 0;
01303       OutputVtxX    = 0;
01304       OutputVtxY    = 0;
01305       OutputVtxU    = 0;
01306       OutputVtxV    = 0;
01307       OutputVtxZ    = 0;
01308       OutputTVtxX   = 0;
01309       OutputTVtxY   = 0;
01310       OutputTVtxZ   = 0;
01311       Outputtpx = 0 ;
01312       Outputtpy = 0;
01313       Outputtpz = 0;
01314       Outputtptype = 0;
01315       OutputNPln    = 0;
01316       OutputNPlnU    = 0;
01317       OutputNPlnV    = 0;
01318       OutputNStp    = 0;
01319       OutputMCPresel = 0;
01320       OutputDataPresel = 0;
01321       OutputXTalk = 0;
01322       OutputXTalkTagged = 0;
01323       OutputXTalkMisTagged = 0;
01324       OutputPhysics = 0;
01325       OutputW2 = 0;
01326       OutputTotPt = 0;
01327       
01328       OutputRecoE   = 0;
01329 
01330       OutputTree->Fill();
01331     }//in case of empty snarl (0 events)
01332 
01333   }//record loop
01334 
01335   OutputTreePOT->Fill();
01336 
01337   cout << " Closing the output file " << endl;
01338   OutputFile->Write();
01339   OutputFile->Close();  
01340   return;  
01341   cout << "Leaving WriteResults()" << endl;
01342 
01343   delete chain;
01344 
01345 }//end of WriteResults


Member Data Documentation

std::vector<ComparisonResultList*> MCNNRunner::_compResList [private]

Definition at line 87 of file MCNNRunner.h.

Referenced by CompactInput(), Finish(), and MakeComparison().

std::vector<int> MCNNRunner::_compResList_size [private]

Definition at line 92 of file MCNNRunner.h.

Referenced by CompactInput(), and MakeComparison().

std::vector<float> MCNNRunner::_compResList_smallestDeltalnL [private]

Definition at line 91 of file MCNNRunner.h.

Referenced by CompactInput(), and MakeComparison().

std::vector<ComparisonResultList*> MCNNRunner::_compResList_untrimmed [private]

Definition at line 95 of file MCNNRunner.h.

Referenced by CompactInput(), and WriteResults().

std::vector<string> MCNNRunner::_files [private]

Definition at line 86 of file MCNNRunner.h.

Referenced by NextLibraryEvent(), and ReadEventLibrary().

std::vector<MinosCompactEvent*> MCNNRunner::_inputAll [private]

Definition at line 88 of file MCNNRunner.h.

Referenced by CompactInput(), Finish(), and MakeComparison().

std::vector<compatibilityInfo_h*> MCNNRunner::_inputAll_compatibilityInfo [private]

Definition at line 89 of file MCNNRunner.h.

Referenced by CompactInput(), Finish(), and MakeComparison().

std::vector<MinosCompactEvent*> MCNNRunner::_inputAll_untrimmed [private]

Definition at line 96 of file MCNNRunner.h.

Referenced by CompactInput(), and WriteResults().

std::vector<float> MCNNRunner::_selflnL [private]

Definition at line 90 of file MCNNRunner.h.

Referenced by CompactInput(), and MakeComparison().

bool MCNNRunner::atleastonelibevent [private]

Definition at line 81 of file MCNNRunner.h.

Referenced by MakeComparison(), MCNNRunner(), and WriteResults().

MinosEventDisplay* MCNNRunner::eventDisplay [private]

Definition at line 100 of file MCNNRunner.h.

Referenced by Finish().

unsigned int MCNNRunner::file_count [private]

Definition at line 73 of file MCNNRunner.h.

Referenced by Initialize(), and NextLibraryEvent().

HitProbTable* MCNNRunner::HPB [private]

Definition at line 99 of file MCNNRunner.h.

Referenced by CompareEventsBody(), and Initialize().

Int_t MCNNRunner::input_first [private]

Definition at line 75 of file MCNNRunner.h.

Referenced by CompactInput(), MCNNRunner(), Run(), and WriteResults().

Int_t MCNNRunner::input_last [private]

Definition at line 76 of file MCNNRunner.h.

Referenced by CompactInput(), MCNNRunner(), Run(), and WriteResults().

bool MCNNRunner::isMRCC [private]

Definition at line 78 of file MCNNRunner.h.

Referenced by Initialize().

int MCNNRunner::KEEP_BEST_N [private]

Definition at line 79 of file MCNNRunner.h.

Referenced by MakeComparison(), and MCNNRunner().

TChain* MCNNRunner::lib_chain [private]

Definition at line 85 of file MCNNRunner.h.

Referenced by MCNNRunner(), and NextLibraryEvent().

int MCNNRunner::library_event_count [private]

Definition at line 82 of file MCNNRunner.h.

Referenced by MakeComparison(), MCNNRunner(), and WriteResults().

int MCNNRunner::MCNNPrecutLevel [private]

Definition at line 80 of file MCNNRunner.h.

MinosCompactEvent* MCNNRunner::pcce [private]

Definition at line 101 of file MCNNRunner.h.

Referenced by Initialize(), MakeComparison(), and NextLibraryEvent().

PECalculator* MCNNRunner::peCalculator [private]

Definition at line 98 of file MCNNRunner.h.

Referenced by CompareEventsBody(), Finish(), and Initialize().

Int_t MCNNRunner::piece [private]

Definition at line 77 of file MCNNRunner.h.

Referenced by MCNNRunner(), Run(), and WriteResults().

Int_t MCNNRunner::srCtr [private]

Definition at line 74 of file MCNNRunner.h.

Referenced by Initialize(), and NextLibraryEvent().


The documentation for this class was generated from the following files:
Generated on Thu Apr 10 23:02:56 2014 for loon by  doxygen 1.4.7