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 385 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, compatibilityInfo_h::nplanes, MinosCompactEvent::nPlanes, compatibilityInfo_h::nstrips, PassesMCNNPrecuts(), MinosCompactEvent::Qtot, compatibilityInfo_h::qtot, ComparisonResultList::Size(), MinosCompactEvent::UStrips, and MinosCompactEvent::VStrips.

Referenced by Run().

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

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

Definition at line 1449 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().

01450 {
01451   comparisonResult_h bestResult;
01452 
01453   float lnLmax = NO_VALID_COMPARISON;
01454 
01455   for(int iPlaneOffset = -1; iPlaneOffset <= +1; ++iPlaneOffset){
01456     // Apply plane shift. It is only safe not to resort the list here
01457     // because of the way comparison is defined in compactStrip_h
01458     // ie planes is the least-significant factor in the comparison.
01459     // If U & V shifts are reintroduced something cleverer will have to
01460     // be done.
01461     typedef vector<compactStrip_h>::iterator it_t;
01462     const it_t endA = eventA->AllStrips.end();
01463     for(it_t itA = eventA->AllStrips.begin(); itA != endA; ++itA)
01464       itA->plane += iPlaneOffset;
01465 
01466     comparisonResult_h result = CompareEventsBody(eventA, eventB, toBeat);
01467 
01468     // Now that we have a good enough result, the criterion for further plane
01469     // shifts is to beat this new value.
01470     if(result.lnL > toBeat) toBeat = result.lnL;
01471 
01472     // Undo plane shift
01473     for(it_t itA = eventA->AllStrips.begin(); itA != endA; ++itA)
01474       itA->plane -= iPlaneOffset;
01475 
01476     if(result.lnL > lnLmax){
01477       lnLmax = result.lnL;
01478       bestResult = result;
01479       bestResult.stripOffsetU = 0;
01480       bestResult.stripOffsetV = 0;
01481       bestResult.planeOffset = iPlaneOffset;
01482     }
01483   } // end for iPlaneOffset
01484 
01485   return bestResult;
01486 }

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

Definition at line 1499 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().

01500 {
01501   // We start with two sorted lists containing all the strips in each event.
01502   // The goal is to find all matching strips, unpaired strips are taken to
01503   // "match" a strip of zero charge.
01504   //
01505   // We go through both lists simultaneously, noticing when we are looking at
01506   // identical strips in each. If the two current strips don't match then whichever
01507   // strip comes earlier in sequence definitely doesn't have a match in the other list.
01508   //
01509   // If our likelihood is ever lower than toBeat then we can bail out early, safe in
01510   // the knowledge that the likelihood of this match can never matter.
01511 
01512   float lnL = 0;
01513   int nmatched = 0;
01514   int nunmatched = 0;
01515   float qmatched = 0;
01516   float qunmatched = 0;
01517 
01518   if(eventA->ChargeType != eventB->ChargeType){
01519     cout << "UTTER FAILURE - Events have different ChargeType" << endl;
01520   }
01521   if(eventA->chargeScale != eventB->chargeScale){
01522     cout << "UTTER FAILURE - Events have different chargeScale" << endl;
01523   }
01524 
01525   const float CS = eventA->chargeScale;
01526   const unsigned short int QT = eventA->ChargeType;
01527 
01528   typedef vector<compactStrip_h>::const_iterator it_t;
01529   it_t itA = eventA->AllStrips.begin();
01530   it_t itB = eventB->AllStrips.begin();
01531   const it_t endA = eventA->AllStrips.end();
01532   const it_t endB = eventB->AllStrips.end();
01533 
01534   // Ensure the AllStrips vectors have been filled
01535   assert(itA != endA);
01536   assert(itB != endB);
01537 
01538   // So long as we have strips left in either list
01539   while(itA != endA || itB != endB){
01540 
01541     int nchargeA = -1;
01542     int nchargeB = -1;
01543 
01544     if(itA != endA && itB != endB &&
01545        itA->plane == itB->plane && itA->strip == itB->strip){
01546       // Both strips exist and have identical positions
01547 
01548       nchargeA = int(itA->icharge/CS + 0.5);
01549       nchargeB = int(itB->icharge/CS + 0.5);
01550 
01551       nmatched += 2;
01552       qmatched += itA->icharge + itB->icharge;
01553 
01554       ++itA;
01555       ++itB;
01556     }
01557     else if(itB == endB || (itA != endA && *itA < *itB)){
01558       // Either there are no more strips in B,
01559       // or the strip in A is earlier than the one in B.
01560       // In either case *itA doesn't have a match in B
01561 
01562       nchargeA = int(itA->icharge/CS + 0.5);
01563       nchargeB = 0;
01564 
01565       ++nunmatched;
01566       qunmatched += itA->icharge;
01567 
01568       ++itA;
01569     }
01570     else if(itA == endA || (itB != endB && *itB < *itA)){
01571       // As above. Here *itB doesn't have a match in A...
01572 
01573       nchargeA = 0;
01574       nchargeB = int(itB->icharge/CS + 0.5);
01575 
01576       ++nunmatched;
01577       qunmatched += itB->icharge;
01578 
01579       ++itB;
01580     }
01581     else{
01582       assert(0 && "This should never happen");
01583     }
01584 
01585     // Double-check that the charges got filled in.
01586     if (nchargeA<0 || nchargeB<0) {
01587       std::cout << "UNEXPECTED! -- " << nchargeA << " " << nchargeB << std::endl;
01588     }
01589     //assert(nchargeA >= 0 && nchargeB >= 0);
01590 
01591     // Calculate the likelihood of these two charges in one of two ways
01592     switch(QT){
01593     case 1: case 2: case 3: case 4: case 6:
01594       lnL += HPB->LogL(nchargeA, nchargeB);
01595       break;
01596     case 0: case 5:
01597       lnL += peCalculator->SimpleLnL(nchargeA, nchargeB);
01598       break;
01599     default:
01600       assert(0 && "Unknown charge type");
01601     };
01602 
01603     // Might as well return what we have already since it can't possibly win
01604     if(lnL < toBeat) break;
01605 
01606   } // end while
01607 
01608   comparisonResult_h result;
01609   result.lnL = lnL;
01610   result.nMatched = nmatched;
01611   result.nUnmatched = nunmatched;
01612   result.fractionQMatched = (qmatched+qunmatched) ? (qmatched/(qmatched+qunmatched)) : 0;
01613   return result;
01614 }

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

Definition at line 1490 of file MCNNRunner.cxx.

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

Referenced by MakeComparison().

01491 {
01492   comparisonResult_h result = CompareEvents(eventA, eventB, toBeat);
01493   if(result.lnL > NO_VALID_COMPARISON) return new ComparisonResult(result);
01494 
01495   return 0;
01496 }

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

Definition at line 1423 of file MCNNRunner.cxx.

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

Referenced by CompactInput(), and MakeComparison().

01423                                                                                     {
01424 
01425   // This is the one routine that gets called (library)*(input) times.
01426   // It needs to be as tight as possible.
01427 
01428   int meanN  = (ciA->nplanes+ciB->nplanes+1)/2;
01429   int cut = 2;
01430   if      (meanN>20) cut=4;
01431   else if (meanN>15) cut=3;
01432   if (abs(ciA->nplanes-ciB->nplanes)>cut) return 0;
01433 
01434   if (ciA->nstrips+ciB->nstrips==0) return 0;
01435   float rat1 = 2.0*fabs(static_cast<float>(ciA->nstrips - ciB->nstrips))/(ciA->nstrips + ciB->nstrips);
01436   if (rat1>0.2) return 0;
01437 
01438   if (ciA->qtot+ciB->qtot==0) return 0;
01439   float rat2 = 2.0*fabs(static_cast<float>(ciA->qtot-ciB->qtot))/(ciA->qtot+ciB->qtot);
01440   if (rat2>0.2) return 0;
01441 
01442   return 1;
01443 }

void MCNNRunner::Finish (  )  [private]

Definition at line 1390 of file MCNNRunner.cxx.

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

Referenced by Run().

01390                        {
01391 
01392   //-->Tidy up
01393   cout << "Finishing; removing:" << endl;
01394 
01395   //objects
01396   if(peCalculator!=NULL)delete peCalculator;
01397   cout << "peCalculator " << endl;
01398   if(eventDisplay!=NULL)delete eventDisplay;
01399   cout << "eventDisplay" << endl;
01400 
01401   //std::vectors
01402   for(UInt_t ievent = 0; ievent<_inputAll.size();++ievent) {
01403     delete _inputAll[ievent];
01404     delete _inputAll_compatibilityInfo[ievent];
01405   }
01406   cout << "_inputAll (and related)" << endl;  
01407   for(UInt_t ievent = 0; ievent<_compResList.size();++ievent) {
01408     delete _compResList[ievent];
01409   }
01410   cout << "_compResList" << endl;
01411   
01412 
01413 }

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 200 of file MCNNRunner.cxx.

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

Referenced by Run().

00201 {
00202   cout << " *** Initialize() ***" << endl;
00203 
00204   //Other variables
00205   isMRCC=false;
00206 
00207   //Start library file & entry count at 0
00208   srCtr=0;
00209   file_count=0;  
00210 
00211   // create the event display if requested
00212   //if(EVENT_DISPLAY)eventDisplay = new MinosEventDisplay(0,true);
00213 
00214   cout << "Initializing with qtype " << qtype << endl;
00215   // create the calculator
00216   //MHO0509 - Type of calculator needed depends on qtype
00217   if (qtype == 0 || qtype == 5) {
00218     peCalculator = new PECalculator();
00219   }
00220   if (qtype == 1 || qtype == 2) {
00221     TFile f("/minos/scratch/nue/Releases/Griffin/Data/LEM/hitprobtable/HitProbTableQtypes1and2.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   if (qtype == 3 || qtype == 4 || qtype == 6) {
00230     TFile f("/minos/scratch/nue/Releases/Griffin/Data/LEM/hitprobtable/HitProbTableQtypes3and4.root");
00231     gROOT->cd();
00232     HPB = (HitProbTable*)f.Get("HPB");
00233     if (!HPB) {
00234       cout << "Failed to get HitProbTable from file.  SEGV coming!" << endl;
00235     }
00236     HPB = (HitProbTable*)HPB->Clone();
00237   }
00238   
00239   // create the CCE
00240   pcce = new MinosCompactEvent(qtype);
00241 
00242   return;
00243 
00244 }

void MCNNRunner::MakeComparison (  )  [private]

Definition at line 518 of file MCNNRunner.cxx.

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

Referenced by Run().

00518                                {
00519 
00520   //-->Looping over library events
00521   while(NextLibraryEvent()){
00522 
00523     library_event_count++;
00524     atleastonelibevent=true;
00525 
00526     // for the faster precut routine:
00527     compatibilityInfo_h *ci_lib = new compatibilityInfo_h;
00528     ci_lib->nstrips = pcce->UStrips.size()+pcce->VStrips.size();
00529     ci_lib->qtot    = pcce->Qtot;
00530     ci_lib->nplanes = pcce->nPlanes;
00531 
00532     //-->Looping over input events
00533 
00534     UInt_t total_input = _inputAll.size();
00535     std::vector<compatibilityInfo_h*>::iterator it = _inputAll_compatibilityInfo.begin();
00536 
00537     for(UInt_t ievent = 0; ievent<total_input;++ievent){    
00538       //cout << "===============================" << endl;//tmp
00539       //cout << "Library event: " << pcce->idnu << "," << pcce->idact << "," << pcce->eNu << " -- " << pcce->UStrips.size() << "," << pcce->VStrips.size() << endl;//tmp
00540 
00541       compatibilityInfo_h *ci_inp = *it++;
00542 
00543       if ( CompatibleEvents(ci_inp,ci_lib) ) {
00544         // passes matching precuts (slower)
00545 
00546         int nsize = 0;
00547         if(_compResList[ievent]) nsize = _compResList_size[ievent];
00548 
00549         float toBeat = NO_VALID_COMPARISON;
00550         // If the list of matches is already full, then an event will need at least this likelihood
00551         // to get into it. Let the CompareEvents function know so it can bail out early if possible.
00552         if(nsize >= KEEP_BEST_N) toBeat = _selflnL[ievent]-_compResList_smallestDeltalnL[ievent];
00553         ComparisonResult* pResult = CompareEventsP(_inputAll[ievent], pcce, toBeat);
00554 
00555         if(pResult){
00556           
00557           float deltaLnL = _selflnL[ievent] - pResult->lnL;
00558 
00559           //-->saving to the ComparisonResultList of this input event
00560           if(nsize < KEEP_BEST_N || deltaLnL<_compResList_smallestDeltalnL[ievent]){
00561             
00562             pResult->dLnL = deltaLnL;
00563             pResult->SetNeutrino(pcce);
00564             
00565             if(nsize==KEEP_BEST_N){//<--remove last
00566               // RBP - this was breaking.
00567               //list<ComparisonResult>::iterator iter_end = _compResList[ievent]->compResultList.end();
00568               //delete &iter_end;//<--actually deallocate memory for this object           
00569               _compResList[ievent]->PopBack();//<-- remove from list (even if now empty)           
00570               _compResList_size[ievent]--;//<-- Decrement size!
00571               
00572             }
00573             
00574             //-->Insert current guy in the right spot to keep list sorted
00575             _compResList[ievent]->InsertSorted(pResult);
00576             _compResList_size[ievent]++;//<-- Increment size!
00577             _compResList_smallestDeltalnL[ievent] = _compResList[ievent]->LastDeltalnL(); //<-- call and hold this value here instead of calling function on every event
00578           }//saving to ComparisonResultList
00579           
00580           delete pResult;
00581 
00582         }//not NULL comparison            
00583 
00584       }//precuts
00585       
00586     }//input loop 
00587     
00588     delete ci_lib;
00589 
00590   }//lib loop
00591   
00592   cout << "Done!" << endl;
00593 
00594 }//end of MakeComparison

bool MCNNRunner::NextLibraryEvent (  )  [private]

Definition at line 280 of file MCNNRunner.cxx.

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

Referenced by MakeComparison().

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

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

Definition at line 313 of file MCNNRunner.cxx.

References NtpSRPlane::beg, det, MuELoss::e, NtpSRPlane::end, NtpStRecord::evt, VldContext::GetDetector(), RecRecordImp< T >::GetHeader(), AtNuAnaUtil::GetPrimaryTrack(), NtpStRecord::GetRelease(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), isMC, kLoosePrecuts, SimFlag::kMC, kMPLoosePrecuts, kMPTightPrecuts, kNoPrecuts, kTightPrecuts, NueConvention::NueEnergyCorrection(), and NtpSRTrack::plane.

Referenced by CompactInput().

00313                                                                                        {
00314 
00315   const NtpSREvent* event = dynamic_cast<const NtpSREvent*>(record->evt->At(eventno));
00316   //don't even bother if event == 0
00317   if (!event) return kFALSE;
00318 
00319 
00320   const NtpSRTrack* track = dynamic_cast<const NtpSRTrack*>(SntpHelpers::GetPrimaryTrack(eventno, const_cast<NtpStRecord*>(record)));
00321   //const NtpSRTrack* track = dynamic_cast<const NtpSRTrack*>(record->trk->At(eventno));
00322 
00323   Detector::Detector_t det = record->GetHeader().GetVldContext().GetDetector();
00324   SimFlag::SimFlag_t   sim = record->GetHeader().GetVldContext().GetSimFlag();
00325   bool isMC = (sim == SimFlag::kMC);
00326   int release = record->GetRelease();
00327 
00328   Int_t trackplanes = (track)?TMath::Abs(track->plane.end - track->plane.beg):0;
00329   //Int_t trklikeplanes = (track)?track->plane.ntrklike:0;
00330 
00331 
00332   //unused//float x = event->vtx.x;
00333   //unused//float y = event->vtx.y;
00334   //unused//float z = event->vtx.z;
00335   float e;
00336   if (det==4) e = 4.0; // for caldet, always pass HACKY!
00337   else e = NueConvention::NueEnergyCorrection(event->ph.mip,release,isMC,det,false); //Otherwise, do the correction
00338   // NueEnergyCorrection is now smart enough to do correct thing and grab MINOSPLUS function for elm5/daikon10
00339   Bool_t inFid = kTRUE;
00340   //Comment it out so no fiducial cut in FD
00341   //if (det == Detector::kFar ) inFid = (NueConvention::IsInsideFarFiducial_Nue_Standard (x,y,z,isMC)==1);
00342   //For now, no fid cut in the near detector (until we work out the vertex correction that's present in NueAna...)
00343   //if (det == Detector::kNear) inFid = (NueConvention::IsInsideNearFiducial_Nue_Extended(x,y,z)==1);
00344  
00345   
00346   switch (MCNNPrecutLevel) {
00347   case kNoPrecuts:
00348     break;
00349   case kLoosePrecuts:
00350     if (!(inFid&&
00351           e>0.5&&
00352           e<12&&
00353           trackplanes<30))
00354       return kFALSE;
00355     break;
00356   case kTightPrecuts:
00357     if (!(inFid&&
00358           e>1&&
00359           e<8&&
00360           trackplanes<25))
00361       return kFALSE;
00362     break;
00363   case kMPLoosePrecuts:
00364     if (!(inFid&&
00365           e>0.5&&
00366           e<16&&
00367           trackplanes<35))
00368       return kFALSE;
00369     break;
00370   case kMPTightPrecuts:
00371     if (!(inFid&&
00372           e>1&&
00373           e<12&&
00374           trackplanes<30))
00375       return kFALSE;
00376     break;
00377   default:
00378     break;  
00379   }  
00380 
00381   return kTRUE;
00382 }

void MCNNRunner::ReadEventLibrary (  )  [private]

Definition at line 249 of file MCNNRunner.cxx.

References _files, gSystem(), and infile.

Referenced by Run().

00249                                  {
00250 
00251   cout << "*** ReadEventLibrary() ***" << endl;
00252 
00253   //--> Read in the list of files from library.filelist
00254   const string fileName= "library.filelist";
00255   ifstream infile(fileName.c_str());
00256   if(!infile){
00257     cerr << "Can't open MC file " << fileName.c_str() << endl;
00258     return;
00259   }
00260   string line;
00261   while( getline(infile,line,'\n')){
00262     if(line[ 0 ] != 'C'){
00263       cout << "Adding file : " << line <<endl;
00264       // handle environment variables here...
00265       char *expanded_line = gSystem->ExpandPathName(line.c_str());
00266       string line_str = expanded_line;
00267       _files.push_back(line_str);
00268       delete expanded_line;
00269     }
00270   }
00271 
00272   cout << "The files array has size " << _files.size() << endl;
00273 
00274 }//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 
00170   cout << fname << " " << entry_first << " " << entry_last << " " << piece << " "<< qtype << endl;
00171 
00172   Initialize(qtype);
00173   cout << "Initialized" << endl;
00174 
00175   //-->Library
00176   ReadEventLibrary();
00177   cout << "Library Read" << endl;
00178 
00179   //-->Input events 
00180   CompactInput(fname,qtype);
00181   cout << "Input Compacted" << endl;
00182 
00183   //-->Compare input and libraries
00184   MakeComparison();
00185   cout << "Comparison Made" << endl;
00186 
00187   //--->Write out results
00188   WriteResults(fname);
00189   cout << "Results Written" << endl;
00190 
00191   //-->Tidy up
00192   Finish();
00193   
00194 }

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 600 of file MCNNRunner.cxx.

References _compResList_untrimmed, _inputAll_untrimmed, atleastonelibevent, DataPreselected(), MuELoss::e, NtpMCTruth::emfrac, NtpStRecord::evthdr, NtpTools::FillRecoEInfo(), NtpMCTruth::flux, SntpHelpers::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(), NtpSREventSummary::nevent, NtpMCTruth::p4neu, NtpMCTruth::p4neunoosc, piece, RecoE::Reset(), MinosAnalysisResult::ResultList, RecoE::totalE, NtpMCFluxInfo::tptype, NtpMCFluxInfo::tpx, NtpMCFluxInfo::tpy, NtpMCFluxInfo::tpz, NtpMCTruth::vtxx, NtpMCTruth::vtxy, NtpMCTruth::vtxz, NtpMCTruth::w2, and NtpMCTruth::y.

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

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

Definition at line 981 of file MCNNRunner.cxx.

References _compResList_untrimmed, _inputAll_untrimmed, DataPreselected(), digits(), MuELoss::e, NtpMCTruth::emfrac, NtpStRecord::evthdr, NtpTools::FillRecoEInfo(), NtpMCTruth::flux, VldContext::GetDetector(), SntpHelpers::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(), NtpSREventSummary::nevent, NtpMCTruth::p4neu, NtpMCTruth::p4neunoosc, piece, RecoE::Reset(), MinosAnalysisResult::ResultList, RecoE::totalE, NtpMCFluxInfo::tptype, NtpMCFluxInfo::tpx, NtpMCFluxInfo::tpy, NtpMCFluxInfo::tpz, NtpMCTruth::vtxx, NtpMCTruth::vtxy, NtpMCTruth::vtxz, NtpMCTruth::w2, and NtpMCTruth::y.

Referenced by Run().

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


Member Data Documentation

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().

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().

Definition at line 89 of file MCNNRunner.h.

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

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().

Definition at line 81 of file MCNNRunner.h.

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

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().

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().

Definition at line 82 of file MCNNRunner.h.

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

Definition at line 80 of file MCNNRunner.h.

Definition at line 101 of file MCNNRunner.h.

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

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 15 Aug 2017 for loon by  doxygen 1.6.1