ChopModule Class Reference

#include <ChopModule.h>

Inheritance diagram for ChopModule:

JobCModule List of all members.

Public Member Functions

 ChopModule ()
 ~ChopModule ()
JobCResult Ana (const MomNavigator *mom)
JobCResult Reco (MomNavigator *mom)
const RegistryDefaultConfig () const

Private Attributes

TFile * fFile
TTree * fTree
TTree * fNuTree
TCanvas * fCanvas1
TCanvas * fCanvas2
TCanvas * fCanvas3
ChopTreeLeaffleaf
ChopNeutrinoLeaffnu
std::vector< TObject * > fCleanup

Detailed Description

Definition at line 20 of file ChopModule.h.


Constructor & Destructor Documentation

ChopModule::ChopModule (  ) 

Definition at line 45 of file ChopModule.cxx.

00045                        :
00046   fFile(0),
00047   fTree(0),
00048   fNuTree(0),
00049   fCanvas1(0),
00050   fCanvas2(0),
00051   fCanvas3(0),
00052   fleaf(0),
00053   fnu(0)
00054 {
00059 }

ChopModule::~ChopModule (  ) 

Definition at line 63 of file ChopModule.cxx.

References fFile, fNuTree, and fTree.

00064 {
00065   // Save evaluation data (if any);
00066   if(fFile) {
00067     fTree->Write();
00068     fNuTree->Write();
00069     fFile->Write();
00070     fFile->Close();
00071   }
00072 
00073 }


Member Function Documentation

JobCResult ChopModule::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 155 of file ChopModule.cxx.

References ChopNeutrinoLeaf::calstrips, ChopNeutrinoLeaf::calstrips1, ChopNeutrinoLeaf::calstrips2, ChopNeutrinoLeaf::calstripsmatch1, ChopNeutrinoLeaf::calstripsmatch2, ChopTreeLeaf::chop, ChopNeutrinoLeaf::chop1, ChopNeutrinoLeaf::chop1_nu, ChopNeutrinoLeaf::chop1_planebeg, ChopNeutrinoLeaf::chop1_planeend, ChopNeutrinoLeaf::chop1_sigcorr, ChopNeutrinoLeaf::chop1_tdc, ChopNeutrinoLeaf::chop1_viscal, ChopNeutrinoLeaf::chop1_visfid, ChopNeutrinoLeaf::chop2, ChopNeutrinoLeaf::chop2_nu, ChopNeutrinoLeaf::chop2_planebeg, ChopNeutrinoLeaf::chop2_planeend, ChopNeutrinoLeaf::chop2_sigcorr, ChopNeutrinoLeaf::chop2_tdc, ChopNeutrinoLeaf::chop2_viscal, ChopNeutrinoLeaf::chop2_visfid, ChopNeutrinoLeaf::complete1, ChopTreeLeaf::complete1, ChopNeutrinoLeaf::complete2, ChopTreeLeaf::complete2, ChopNeutrinoLeaf::complete_tot1, ChopNeutrinoLeaf::complete_tot2, ChopNeutrinoLeaf::completet1, ChopNeutrinoLeaf::completet2, Draw(), ChopEvaluation::Evaluate(), fCanvas1, fCanvas2, fCanvas3, fCleanup, fFile, CandRecord::FindCandHandle(), fleaf, fnu, ChopEvaluation::fNuMatch, ChopEvaluation::fNuMatch_cal, ChopEvaluation::fNuMatch_calstrips, ChopEvaluation::fNuMatch_calt, ChopEvaluation::fNuMatch_caltfid, ChopEvaluation::fNuMatch_fid, ChopEvaluation::fNuMatch_strips, fNuTree, Form(), fTree, Munits::g, Registry::GetCharString(), JobCModule::GetConfig(), CandHandle::GetDaughterIterator(), Registry::GetDouble(), Detector::GetEntries(), MomNavigator::GetFragment(), Registry::GetInt(), Truthifier::GetListOfNeutrinoIndecies(), CandHandle::GetNDaughters(), Truthifier::GetNeuKin(), Truthifier::GetNeutrinoOfTrack(), DataUtil::GetRunSnarlEvent(), Truthifier::GetScintHit(), Truthifier::GetScintHitListSize(), VldContext::GetSimFlag(), Truthifier::GetStdHepParticle(), UgliGeomHandle::GetStripHandle(), Calibrator::GetTDCFromTime(), UgliStripHandle::GetTPos(), CandHandle::GetVldContext(), Calibrator::Instance(), Truthifier::Instance(), Truthifier::IsDigitFromNeutrino(), Msg::kDebug, JobCResult::kError, SimFlag::kMC, CalTimeType::kNone, JobCResult::kPassed, kQieRcid, CalDigitType::kSigCorr, PlaneView::kU, Msg::kWarning, MSG, plots(), ChopNeutrinoLeaf::Reset(), ChopTreeLeaf::Reset(), run(), JobCResult::SetFailed(), JobCResult::SetWarning(), ChopNeutrinoLeaf::sigcorr, ChopNeutrinoLeaf::snarl, ChopTreeLeaf::snarl, ChopNeutrinoLeaf::strips, ChopNeutrinoLeaf::strips1, ChopTreeLeaf::strips1, ChopNeutrinoLeaf::strips2, ChopTreeLeaf::strips2, ChopNeutrinoLeaf::stripsmatch1, ChopNeutrinoLeaf::stripsmatch2, TimeRankHistos(), ChopNeutrinoLeaf::viscal, ChopTreeLeaf::viscal1, ChopTreeLeaf::viscal2, ChopNeutrinoLeaf::viscalt, ChopTreeLeaf::viscalt1, ChopTreeLeaf::viscalt2, ChopNeutrinoLeaf::visfid, ChopNeutrinoLeaf::visfidt, ChopTreeLeaf::visfidt1, and ChopTreeLeaf::visfidt2.

00156 {  
00157   JobCResult result;
00158 
00159   // Find PrimaryCandidateRecord fragment in MOM.
00160   CandRecord *candrec = dynamic_cast<CandRecord *>
00161     (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00162   if (candrec == 0) {
00163     MSG("Chop", Msg::kWarning) << "No PrimaryCandidateRecord in  MOM."
00164                                << endl;
00165     result.SetWarning().SetFailed();
00166     return result;
00167   }  
00168   // Get CandDigits.
00169   CandDigitListHandle *cdlh_ptr = dynamic_cast<CandDigitListHandle *>
00170     (candrec->FindCandHandle("CandDigitListHandle", "canddigitlist"));
00171   if(cdlh_ptr==0) {
00172     MSG("Chop", Msg::kWarning) << "Couldn't find CandDigitListHandle." << endl;
00173     return JobCResult::kError;
00174   }
00175 
00176   // Get context. Bail out if this isn't MC.
00177   VldContext context = *(cdlh_ptr->GetVldContext());
00178   if(context.GetSimFlag() != SimFlag::kMC) {
00179     // MSG("Chop", Msg::kWarning) << "Running ChopModule::Ana is usless on non-MC data." << endl;
00180     //return JobCResult::kWarning;
00181   }
00182 
00183   // Get list of Chops.
00184   CandChopListHandle *choplist_ptr = dynamic_cast<CandChopListHandle *>
00185     (candrec->FindCandHandle("CandChopListHandle", "candchoplist"));
00186   if(choplist_ptr==0) {
00187     MSG("Chop", Msg::kWarning) << "Can't find ChopListHandle." << endl;
00188   }
00189   // Get list of SR slices.
00190   CandSliceListHandle *srslicelist_ptr = dynamic_cast<CandSliceListHandle *>
00191     (candrec->FindCandHandle("CandSliceListHandle", "CandSliceList"));
00192   //if(srslicelist_ptr==0) return JobCResult::kError;
00193 
00194   // Get simsnarl. Bail if we can't find it.
00195   bool haveTruth = false;
00196   SimSnarlRecord *ssr =
00197     dynamic_cast<SimSnarlRecord*>(mom->GetFragment("SimSnarlRecord"));
00198   if (!ssr){
00199     MSG("Chop", Msg::kWarning) << "ChopModule::Ana couldn't find SimSnarl data, which it needs." << endl;
00200     haveTruth = false;
00201   } else {
00202     haveTruth = true;
00203   }
00204 
00206   // Get config
00207   double particleTimeout = GetConfig().GetDouble("particleTimeout");
00208   const char* filename   = GetConfig().GetCharString("filename");
00209   int         plots      = GetConfig().GetInt("plots");
00210 
00212   // Set up files, trees, etc
00213   TDirectory* oldDir = gDirectory;
00214 
00215   if(fFile==0) {
00216     fFile = new TFile(filename,"RECREATE");
00217     fFile->cd();
00218 
00219     fleaf = new ChopTreeLeaf;    
00220     fTree = new TTree("mytree","mytree");
00221     fTree->Branch("chopbr","ChopTreeLeaf",&fleaf);
00222     fTree->Write();
00223     
00224     fnu = new ChopNeutrinoLeaf; 
00225     fNuTree = new TTree("nutree","nutree");
00226     fNuTree->Branch("nubr","ChopNeutrinoLeaf",&fnu);
00227     fNuTree->Write();
00228     
00229     fFile->Write();
00230   }
00231   assert(fFile);
00232   fFile->cd();
00233 
00234 
00236   // Get context info: truth data, geometry, run number etc.
00237 
00238   // Find run number, etc:
00239   int run = -1, snarl = -1, event = -1;
00240   DataUtil::GetRunSnarlEvent(mom,run,snarl,event);
00241   // Get truth info:
00242   const Truthifier& truth = Truthifier::Instance(mom);
00243 
00244   // Get geometry:
00245   UgliGeomHandle ugli(context);
00246   // Find global time offset:
00247   //double timeOffset = 0;
00248   //const SimEventResult* ser = dynamic_cast<const SimEventResult*>
00249   //  (ssr->FindComponent("SimEventResult"));
00250   
00252   // Prep plots
00253   // Delete old histograms, if around.
00254   for(UInt_t ih = 0; ih<fCleanup.size(); ih++) delete fCleanup[ih];
00255   fCleanup.clear();
00256   
00258   // Make list of digits.
00259   DigitVector allDigits(cdlh_ptr);
00260 
00262   // Make list of chops.
00263   std::vector<DigitVector> chopList;
00264   if(choplist_ptr) {
00265     chopList.resize(choplist_ptr->GetNDaughters());
00266     
00267     CandDigitListHandleItr chopItr(choplist_ptr->GetDaughterIterator());
00268     UInt_t ichop=0;
00269     while( CandDigitListHandle* cdlh= chopItr() ) {
00270       chopList[ichop++].FillFrom(cdlh);
00271     }
00272     MSG("Chop",Msg::kDebug) << "Found " << chopList.size() << " Chops." << endl;
00273   }
00275   // Make list of SR slices.
00276   std::vector<DigitVector> refSliceList;
00277 
00278   if(srslicelist_ptr) {
00279     refSliceList.resize(srslicelist_ptr->GetNDaughters());
00280     CandSliceHandleItr cshItr(srslicelist_ptr->GetDaughterIterator());
00281 
00282     UInt_t ichop=0;
00283     while(CandSliceHandle* slice = cshItr()) {
00284       refSliceList[ichop++].FillFrom(slice);
00285     }
00286   } 
00287   MSG("Chop",Msg::kDebug) << "Found " << refSliceList.size() << " SR Slices." << endl;
00288   
00290   // Find earliest digit, last digit
00291     
00292   int tfirst = 90000000;
00293   int tlast  = -1;
00294   for(UInt_t idig = 0; idig<allDigits.size(); idig++) {
00295     CandDigitHandle cdh = allDigits[idig];
00296     int tdc = Calibrator::Instance().GetTDCFromTime(cdh.GetTime(CalTimeType::kNone), kQieRcid);    
00297     //int tdc2 = truth.GetRawDigit(cdh)->GetTDC();
00298     //if(tdc!=tdc2) MSG("Chop",Msg::kDebug) << "Round error: " << tdc << "/t" << tdc2 << endl;    
00299     if(tdc<tfirst) tfirst = tdc;
00300     if(tdc>tlast)  tlast  = tdc;
00301   }
00302 
00303   tfirst -= 5; // Pad with extra bins.
00304   tlast  += 5; // Ditto.
00305 
00306   // Neutrinos
00307   std::vector<Int_t> neutrinos(0);
00308   std::vector<TH1*>  nuHist(neutrinos.size());
00309   std::vector<TH1*>  nuHistInt(neutrinos.size());
00310   std::vector<float>  nuGraphTdc;
00311   std::vector<float>  nuGraphPlane;
00312   std::vector<float>  nuGraphE;
00313   std::vector<int>    nuGraphNu;
00314   std::vector<UInt_t> nuNGraph(neutrinos.size(),0); // How many points in each neutrino graph
00315 
00316   if(haveTruth) { // Have truth info
00317 
00319     // Make list of true neutrinos.  
00320     neutrinos = truth.GetListOfNeutrinoIndecies();
00321 
00323     // TZero times for neutrinos
00324 
00325     vector<double>  nuTZero(neutrinos.size(),1e19);  
00326   
00327     // Look at hits, find start times.
00328     for(Int_t s=0;s<truth.GetScintHitListSize(); s++) {
00329       const DigiScintHit* hit = truth.GetScintHit(s);
00330       if(hit){
00331         int nu_index = truth.GetNeutrinoOfTrack(hit->TrackId());
00332         for(UInt_t inu=0;inu<neutrinos.size();inu++) {
00333           if(neutrinos[inu]==nu_index){
00334             double t = hit->T1();
00335             if(t<nuTZero[inu]) nuTZero[inu]=t;
00336           }
00337         }
00338       }
00339     }
00340 
00343 
00344     ChopEvaluation allEval;
00345     allEval.Evaluate(allDigits,
00346                      truth, neutrinos,nuTZero, particleTimeout);
00347   
00349     // Create lists of neutrino digits.
00350     std::vector< std::vector<CandDigitHandle> >nuDigits(neutrinos.size());
00351     std::vector<ChopEvaluation> nuEval(neutrinos.size());
00352   
00353     for(UInt_t idig=0;idig<allDigits.size(); idig++) {
00354       for(UInt_t inu=0; inu < neutrinos.size(); inu++) {
00355         //float frac = truth.IsDigitFromNeutrino(neutrinos[inu],allDigits[idig]);
00356         float fract = truth.IsDigitFromNeutrino(neutrinos[inu],allDigits[idig],nuTZero[inu]+particleTimeout);
00357         if(fract>0) nuDigits[inu].push_back(allDigits[idig]);
00358       }
00359     }
00360     // evaluate each neutrino list.
00361     for(UInt_t inu=0; inu < neutrinos.size(); inu++) {
00362       nuEval[inu].Evaluate(nuDigits[inu],
00363                            truth, neutrinos,nuTZero, particleTimeout);
00364     }
00365 
00367     // Truth info for each neutrino:
00368     std::vector<ChopNeutrinoInfo> nuInfo(neutrinos.size());
00369 
00370     for(UInt_t inu=0; inu < neutrinos.size(); inu++) {
00371       const REROOT_NeuKin* neukin = truth.GetNeuKin(inu);
00372       const TParticle*     part   = truth.GetStdHepParticle(neutrinos[inu]);
00373       if(!neukin) continue;
00374       if(!part) continue;
00375       nuInfo[inu].inu = inu;
00376       nuInfo[inu].vtxt   = part->T();
00377       nuInfo[inu].vtxtdc = Calibrator::Instance().GetTDCFromTime(part->T(),kQieRcid);
00378       nuInfo[inu].vtxx   = part->Vx();
00379       nuInfo[inu].vtxy   = part->Vy();
00380       nuInfo[inu].vtxz   = part->Vz();
00381       nuInfo[inu].enu    = neukin-> P4Neu()[3];
00382       nuInfo[inu].emu    = neukin-> P4Mu1()[3] + neukin->P4Mu2()[3];
00383       nuInfo[inu].eem    = neukin-> P4El1()[3] + neukin->P4El2()[3];
00384       nuInfo[inu].eshw   = neukin-> P4Shw()[3];
00385       nuInfo[inu].evis   = nuInfo[inu].emu+nuInfo[inu].eem+nuInfo[inu].eshw;
00386       nuInfo[inu].iaction= neukin-> IAction();
00387       nuInfo[inu].X      = neukin->X();
00388       nuInfo[inu].Y      = neukin->Y();
00389       nuInfo[inu].tzero  = nuTZero[inu]; 
00390     }
00391   
00393     // Evaluate each chop.
00394     std::vector<ChopEvaluation> chopEval;
00395 
00396     if(GetConfig().GetInt("eval_sr") ==0) {
00397       // Evaluate the chopper.
00398       chopEval.resize(chopList.size());
00399       for(UInt_t ichop=0; ichop<chopEval.size(); ichop++) {
00400         chopEval[ichop].Evaluate(chopList[ichop],
00401                                  truth, neutrinos,nuTZero, particleTimeout);
00402       }
00403     } else {
00404       // Evaluate the SR Slicer.
00405       chopEval.resize(refSliceList.size());
00406       for(UInt_t ichop=0; ichop<chopEval.size(); ichop++) {
00407         chopEval[ichop].Evaluate(refSliceList[ichop],
00408                                  truth, neutrinos,nuTZero, particleTimeout);
00409       }
00410     }
00411 
00413     // Start evaluation of my slicing
00415 
00416 
00417     for(UInt_t ichop = 0; ichop < chopEval.size(); ichop++) {
00418       fleaf->Reset();
00419       fleaf->snarl    = snarl;
00420       fleaf->chop    = ichop;
00421       (*(ChopEvaluation*)fleaf) = (chopEval[ichop]);
00422 
00423     
00424       // Best neutrino info:
00425       fleaf->complete1 = 0;
00426       fleaf->viscal1 = 0;
00427       fleaf->viscalt1 = 0;
00428       fleaf->visfidt1 = 0;
00429       fleaf->strips1 = 0;
00430       if(chopEval[ichop].fBestNeutrino1>=0) {
00431         (*(ChopNeutrinoInfo*)fleaf) = nuInfo[chopEval[ichop].fBestNeutrino1];
00432         fleaf->complete1 = chopEval[ichop].fNuMatch_calt[chopEval[ichop].fBestNeutrino1] / 
00433           allEval.fNuMatch_calt[chopEval[ichop].fBestNeutrino1];
00434         fleaf->viscal1 =  allEval.fNuMatch_cal[chopEval[ichop].fBestNeutrino1];
00435         fleaf->viscalt1 = allEval.fNuMatch_calt[chopEval[ichop].fBestNeutrino1];
00436         fleaf->visfidt1 = allEval.fNuMatch_caltfid[chopEval[ichop].fBestNeutrino1];
00437         fleaf->strips1  = allEval.fNuMatch_strips[chopEval[ichop].fBestNeutrino1];
00438       }
00439 
00440       // Second best neutrino info:
00441       fleaf->complete2 = 0;
00442       fleaf->viscal2 = 0;
00443       fleaf->viscalt2 = 0;
00444       fleaf->visfidt2 = 0;
00445       fleaf->strips2 = 0;
00446       if(chopEval[ichop].fBestNeutrino2>=0) {
00447         (*(ChopNeutrinoInfo*)fleaf) = nuInfo[chopEval[ichop].fBestNeutrino2];
00448         fleaf->complete2 = chopEval[ichop].fNuMatch_calt[chopEval[ichop].fBestNeutrino2] / 
00449           allEval.fNuMatch_calt[chopEval[ichop].fBestNeutrino2];
00450         fleaf->viscal2 =  allEval.fNuMatch_cal[chopEval[ichop].fBestNeutrino2];
00451         fleaf->viscalt2 = allEval.fNuMatch_calt[chopEval[ichop].fBestNeutrino2];
00452         fleaf->visfidt2 = allEval.fNuMatch_caltfid[chopEval[ichop].fBestNeutrino2];
00453         fleaf->strips2  = allEval.fNuMatch_strips[chopEval[ichop].fBestNeutrino2];
00454       }
00455     
00456       fTree->Fill();
00457     }
00458 
00459 
00460   
00462     // Start evaluation of neutrinos
00464 
00465     for(UInt_t inu=0; inu < neutrinos.size(); inu++) {
00466      
00467       // Find best and second-best chop for this neutrino
00468 
00469       int neutrinoToChop1 = -1;
00470       int neutrinoToChop2 = -1;
00471       float neutrinoComplete1 = 0;
00472       float neutrinoComplete2 = 0;
00473     
00474       for(UInt_t ichop = 0; ichop<chopEval.size(); ichop++) {
00475         float complete = chopEval[ichop].fNuMatch_cal[inu]/allEval.fNuMatch_cal[inu];
00476 
00477         if(complete>neutrinoComplete1) {
00478           neutrinoComplete1 = complete;
00479           neutrinoToChop1 = ichop;
00480         }
00481       }
00482 
00483       for(UInt_t ichop = 0; ichop<chopEval.size(); ichop++) {
00484         float complete = chopEval[ichop].fNuMatch_cal[inu]/allEval.fNuMatch_cal[inu];
00485 
00486         if((complete>neutrinoComplete2) && ((int)ichop!= neutrinoToChop1)) {
00487           neutrinoComplete2 = complete;
00488           neutrinoToChop2 = ichop;
00489         }
00490       }
00491       
00492       if(allEval.fNuMatch_cal[inu] > 0 ) {
00493         MSG("Chop",Msg::kDebug) << "Neutrino " << inu 
00494                                 << "\tVisCal = " << allEval.fNuMatch_cal[inu]
00495                                 << " \tTDC = " << nuEval[inu].fBigTdc
00496                                 << " \tTrueStartTime = " << nuTZero[inu]*1e9 << endl;
00497         if(neutrinoToChop1<0) {
00498           MSG("Chop",Msg::kDebug) << "\t\t missed completely." << endl;
00499         } 
00500         else if(chopEval[neutrinoToChop1].fBestNeutrino1!=(int)inu) {
00501           MSG("Chop",Msg::kDebug) << "\t\t" 
00502                                   << " got absorbed ( completeness " << neutrinoComplete1 << ")"             
00503                                   << " by chop " << neutrinoToChop1
00504                                   << " time: " << chopEval[neutrinoToChop1].fBigTdc 
00505                                   << " which came from a neutrino " << chopEval[neutrinoToChop1].fBestNeutrino1
00506                                   << " viscalt: " << allEval.fNuMatch_calt[chopEval[neutrinoToChop1].fBestNeutrino1]
00507                                   << endl;
00508         
00509         } else {
00510           MSG("Chop",Msg::kDebug) << "\t\t" 
00511                                   << "matches chop " << neutrinoToChop1 
00512                                   << " completeness = " << neutrinoComplete1 
00513                                   << " Strips: nu/chop/match = " 
00514                                   << allEval.fNuMatch_strips[inu] << "/" 
00515                                   << chopEval[neutrinoToChop1].fStrips << "/"  
00516                                   << chopEval[neutrinoToChop1].fNuMatch_strips[inu]  
00517                                   << endl;
00518         }
00519         //for(UInt_t ichop = 0; ichop<chopEval.size(); ichop++) {
00520         //      float complete = chopEval[ichop].fNuMatch_calt[inu]/allEval.fNuMatch_calt[inu];
00521         //      MSG("Chop",Msg::kDebug) << "\t\tchop " << ichop << "\t" << complete << endl;
00522         //}
00523       }
00524     
00525 
00526       fnu->Reset();
00527       *((ChopNeutrinoInfo*)fnu) = nuInfo[inu];
00528       *((ChopEvaluation*)fnu)   = nuEval[inu];
00529 
00530       fnu->snarl = snarl;
00531       fnu->viscal = allEval.fNuMatch_cal[inu];
00532       fnu->viscalt= allEval.fNuMatch_calt[inu];
00533       fnu->visfidt= allEval.fNuMatch_caltfid[inu];
00534       fnu->visfid = allEval.fNuMatch_fid[inu];
00535       fnu->sigcorr= nuEval[inu].fSigcor;
00536       fnu->strips = allEval.fNuMatch_strips[inu];
00537       fnu->calstrips = allEval.fNuMatch_calstrips[inu];
00538 
00539       fnu->chop1 = neutrinoToChop1;
00540       if(neutrinoToChop1>=0) {
00541         fnu->complete1      = neutrinoComplete1;
00542         fnu->completet1     = chopEval[neutrinoToChop1].fNuMatch_calt[inu]/allEval.fNuMatch_calt[inu];
00543         fnu->complete_tot1  = chopEval[neutrinoToChop1].fNuMatch[inu]/allEval.fNuMatch[inu];
00544         fnu->strips1        = chopEval[neutrinoToChop1].fStrips;
00545         fnu->calstrips1     = chopEval[neutrinoToChop1].fCalStrips;
00546         fnu->stripsmatch1   = chopEval[neutrinoToChop1].fNuMatch_strips[inu];
00547         fnu->calstripsmatch1= chopEval[neutrinoToChop1].fNuMatch_calstrips[inu];
00548         fnu->chop1_sigcorr= chopEval[neutrinoToChop1].fSigcor;
00549         fnu->chop1_viscal = chopEval[neutrinoToChop1].fSigcor_cal;
00550         fnu->chop1_visfid = chopEval[neutrinoToChop1].fSigcor_fid;
00551         fnu->chop1_nu     = chopEval[neutrinoToChop1].fBestNeutrino1;
00552         fnu->chop1_tdc    = chopEval[neutrinoToChop1].fBigTdc;
00553         fnu->chop1_planebeg= chopEval[neutrinoToChop1].fPlaneBeg;
00554         fnu->chop1_planeend= chopEval[neutrinoToChop1].fPlaneEnd;
00555       }
00556     
00557       fnu->chop2 = neutrinoToChop2;
00558       if(neutrinoToChop2>=0) {
00559         fnu->complete2      = neutrinoComplete2;
00560         fnu->completet2     = chopEval[neutrinoToChop2].fNuMatch_calt[inu]/allEval.fNuMatch_calt[inu];
00561         fnu->complete_tot2  = chopEval[neutrinoToChop2].fNuMatch[inu]/allEval.fNuMatch[inu];
00562         fnu->strips2      = chopEval[neutrinoToChop2].fStrips;
00563         fnu->calstrips2      = chopEval[neutrinoToChop2].fCalStrips;
00564         fnu->stripsmatch2 = chopEval[neutrinoToChop2].fNuMatch_strips[inu];
00565         fnu->calstripsmatch2 = chopEval[neutrinoToChop2].fNuMatch_calstrips[inu];
00566         fnu->chop2_sigcorr= chopEval[neutrinoToChop2].fSigcor;
00567         fnu->chop2_viscal = chopEval[neutrinoToChop2].fSigcor_cal;
00568         fnu->chop2_visfid = chopEval[neutrinoToChop2].fSigcor_fid;
00569         fnu->chop2_nu     = chopEval[neutrinoToChop2].fBestNeutrino1;
00570         fnu->chop2_tdc    = chopEval[neutrinoToChop2].fBigTdc;
00571         fnu->chop2_planebeg= chopEval[neutrinoToChop2].fPlaneBeg;
00572         fnu->chop2_planeend= chopEval[neutrinoToChop2].fPlaneEnd;
00573       }
00574 
00575 
00576       fNuTree->Fill();
00577     }
00578 
00579     if(plots) {
00580       nuHist.resize(neutrinos.size(),0);
00581       nuHistInt.resize(neutrinos.size(),0);
00582       nuNGraph.resize(neutrinos.size(),0);
00583       for(UInt_t inu = 0;inu < neutrinos.size(); inu++) {
00584         nuHist[inu] = new TH1F(Form("nu_%d",inu),
00585                                Form("Hits Nu:%d ",inu ),
00586                                600, 0, 600);    
00587         nuHistInt[inu] = new TH1F(Form("nuint_%d ",inu ),
00588                                   Form("Hits Nu:%d ",inu),
00589                                   600, 0, 600);        
00590         fCleanup.push_back(nuHist[inu]);
00591         fCleanup.push_back(nuHistInt[inu]);
00592       }
00593     
00594       // 
00595       // run through digits for plotting
00596       //
00597     
00598       for(UInt_t idig = 0; idig<allDigits.size(); idig++) {
00599         CandDigitHandle cdh = allDigits[idig];
00600         int tdc =  Calibrator::Instance().GetTDCFromTime(cdh.GetTime(CalTimeType::kNone), kQieRcid);    
00601         float sigcor =  cdh.GetCharge(CalDigitType::kSigCorr);
00602         int t = (tdc-tfirst);
00603         int plane = cdh.GetPlexSEIdAltL().GetPlane();
00604         PlexStripEndId seid = cdh.GetPlexSEIdAltL().GetBestSEId();
00605         UgliStripHandle ustrip = ugli.GetStripHandle(seid);
00606    
00607         if(plane<121) {
00608 
00609           for(UInt_t inu=0;inu<neutrinos.size();inu++) {
00610             int neu = neutrinos[inu];
00611             float frac  = truth.IsDigitFromNeutrino(neu,cdh);
00612             float fract = truth.IsDigitFromNeutrino(neu,cdh,nuTZero[inu]+particleTimeout);
00613             if(frac>0) {         
00614               nuHist[inu]->Fill(t,fract*sigcor);
00615 
00616               /*
00619             // find timing offset.
00620             // Reduced time: plane*0.0594m/c * 53.1e6
00621             const double c_buckets_per_plane = 0.0594 * 53.1e6/3e8;
00622 
00623             double tred = t - plane*c_buckets_per_plane;
00624             // Take off clear fibre length.
00625             tred -= ustrip.ClearFiber(seid.GetEnd()) * 1.6*53.1e6/3e8;
00626             
00627             // Take off green fibre length.
00628             const double rsqrt2 = 1.0/sqrt(2.0);
00629             const TVector3 kU(rsqrt2,rsqrt2,0.);
00630             const TVector3 kV(-rsqrt2,rsqrt2,0.);
00631             const TVector3 kBeamSpot(1.4885, 0.1397,0);
00632             Float_t stripX = 0.;
00633             if (seid.GetPlaneView()==PlaneView::kU) {
00634             float tpos = kBeamSpot.Dot(kV);
00635             float lambda = kV.Dot(ustrip.GlobalPos(0.));            
00636             stripX = -tpos + lambda;
00637             } else {        
00638             float tpos = kBeamSpot.Dot(kU);
00639             float lambda = kU.Dot(ustrip.GlobalPos(0.));
00640             stripX = tpos - lambda;
00641             }       
00642             double halfgreen = ustrip.GetHalfLength() + ustrip.WlsPigtail(seid.GetEnd());
00643             double wlsLen = halfgreen;
00644             wlsLen -= stripX;
00645             
00646             tred -= wlsLen * 1.6*53.1e6/3e8;
00647             
00648             nuHist[inu]->Fill(tred+0.0,fract*sigcor/10.);
00649             nuHist[inu]->Fill(tred+0.1,fract*sigcor/10.);
00650             nuHist[inu]->Fill(tred+0.2,fract*sigcor/10.);
00651             nuHist[inu]->Fill(tred+0.3,fract*sigcor/10.);
00652             nuHist[inu]->Fill(tred+0.4,fract*sigcor/10.);
00653             nuHist[inu]->Fill(tred+0.5,fract*sigcor/10.);
00654             nuHist[inu]->Fill(tred+0.6,fract*sigcor/10.);
00655             nuHist[inu]->Fill(tred+0.7,fract*sigcor/10.);
00656             nuHist[inu]->Fill(tred+0.8,fract*sigcor/10.);
00657             nuHist[inu]->Fill(tred+0.9,fract*sigcor/10.);
00658               */
00659               //nuHist[inu]->Fill(t,fract*sigcor);
00660 
00661               //nuHist[inu+neutrinos.size()]->Fill(t,fract*sigcor);
00662               nuGraphTdc.push_back(t);
00663               nuGraphPlane.push_back(plane);
00664               nuGraphNu.push_back(inu);
00665               nuGraphE.push_back(frac*sigcor);      
00666               nuNGraph[inu]++;
00667             }
00668           }
00669         }
00670       }
00671     }
00672   } // End haveTruth
00673 
00675   // Draw plots.
00677 
00678 
00679   if(plots) {
00680     //
00681     // Set up plots and data lists
00682     //
00683     
00684     fFile->cd();
00685     fFile->mkdir(Form("snarl%d",snarl));
00686     fFile->cd(Form("snarl%d",snarl));
00687 
00688     
00689     TH1* hitHist = 0;
00690     TH2* hit2Hist = 0;
00691     TH2* hitUHist = 0;
00692     TH2* hitVHist = 0;
00693 
00694     hitHist = new TH1F(Form("hits"),
00695                        Form("Digits Snarl %d",snarl),
00696                        600, 0, 600);
00697     fCleanup.push_back(hitHist);
00698     
00699     hit2Hist = new TH2F(Form("hits2"),
00700                         Form("Hits Vs Plane"),
00701                         600,0, 600,
00702                         61, 0, 121);
00703     fCleanup.push_back(hit2Hist);
00704     
00705     hitUHist = new TH2F(Form("hitsu"),
00706                         Form("Hits Vs U TPos"),
00707                         600,0, 600,
00708                         100, -2, 2);
00709     fCleanup.push_back(hitUHist);
00710     
00711     hitVHist = new TH2F(Form("hitsv"),
00712                         Form("Hits Vs V TPos"),
00713                         600,0, 600,
00714                         100, -2, 2);
00715     fCleanup.push_back(hitVHist);
00716     
00717     for(UInt_t idig = 0; idig<allDigits.size(); idig++) {
00718       CandDigitHandle cdh = allDigits[idig];
00719       int tdc =  Calibrator::Instance().GetTDCFromTime(cdh.GetTime(CalTimeType::kNone), kQieRcid);    
00720       float sigcor =  cdh.GetCharge(CalDigitType::kSigCorr);
00721       int t = (tdc-tfirst);
00722       int plane = cdh.GetPlexSEIdAltL().GetPlane();
00723       PlaneView::PlaneView_t view = cdh.GetPlexSEIdAltL().GetBestSEId().GetPlaneView();
00724       PlexStripEndId seid = cdh.GetPlexSEIdAltL().GetBestSEId();
00725       UgliStripHandle ustrip = ugli.GetStripHandle(seid);
00726       float tpos = ustrip.GetTPos();
00727 
00728       if(plane<121) {
00729         hitHist->Fill (t, sigcor);
00730         hit2Hist->Fill(t, plane, sigcor);
00731 
00732         if(view==PlaneView::kU) hitUHist->Fill(t, tpos, sigcor);
00733         else                    hitVHist->Fill(t, tpos, sigcor);
00734       }
00735     }
00736   
00737 
00738     // Chops
00739     std::vector<TH1*>   chopHist(chopList.size());
00740     std::vector<TH1*>   chopHistInt(chopList.size());
00741     std::vector<float>  chopGraphTdc;
00742     std::vector<float>  chopGraphPlane;
00743     std::vector<float>  chopGraphE;
00744     std::vector<int>    chopGraphChop;
00745     std::vector<UInt_t> chopNGraph(chopList.size(),0);
00746 
00747     for(UInt_t ichop = 0;ichop < chopList.size(); ichop++) {
00748       chopHist[ichop] = new TH1F(Form("chp_%d",ichop),
00749                                  Form("Hits Chop:%d",ichop),
00750                                  600, 0, 600);    
00751       chopHistInt[ichop] = new TH1F(Form("chpint_%d",ichop),
00752                                     Form("Hits Chop:%d ",ichop),
00753                                     600, 0, 600);        
00754       fCleanup.push_back(chopHist[ichop]);
00755       fCleanup.push_back(chopHistInt[ichop]);
00756 
00757       for(UInt_t idig = 0; idig < chopList[ichop].size(); idig++) {
00758         CandDigitHandle cdh = chopList[ichop][idig];
00759         int tdc =  Calibrator::Instance().GetTDCFromTime(cdh.GetTime(CalTimeType::kNone), kQieRcid);    
00760         float sig =  cdh.GetCharge(CalDigitType::kSigCorr);
00761         int t = (tdc-tfirst);
00762         int plane = cdh.GetPlexSEIdAltL().GetPlane();
00763         if(plane<121) {
00764           chopHist[ichop]->Fill(t,sig);
00765          
00766           chopGraphTdc.push_back(t);
00767           chopGraphPlane.push_back(plane);
00768           chopGraphE.push_back(sig);
00769           chopGraphChop.push_back(ichop);
00770           chopNGraph[ichop]++;
00771         }
00772       }
00773     }
00774     
00775     // Referece slices
00776     std::vector<TH1*>   refSliceHist(refSliceList.size());
00777     std::vector<TH1*>   refSliceHistInt(refSliceList.size());
00778     std::vector<float>  refSliceGraphTdc;
00779     std::vector<float>  refSliceGraphPlane;
00780     std::vector<float>  refSliceGraphE;
00781     std::vector<int>    refSliceGraphSlice;
00782     std::vector<UInt_t> refSliceNGraph(refSliceList.size(),0);
00783 
00784     for(UInt_t ichop = 0;ichop < refSliceList.size(); ichop++) {
00785       refSliceHist[ichop] = new TH1F(Form("refchp_%d",ichop),
00786                                      Form("Hits RefSlice:%d",ichop),
00787                                      600, 0, 600);    
00788       refSliceHistInt[ichop] = new TH1F(Form("refchpint_%d",ichop),
00789                                         Form("Hits RefSlice:%d ",ichop),
00790                                         600, 0, 600);        
00791       fCleanup.push_back(refSliceHist[ichop]);
00792       fCleanup.push_back(refSliceHistInt[ichop]);
00793 
00794       for(UInt_t idig = 0; idig < refSliceList[ichop].size(); idig++) {
00795         CandDigitHandle cdh = refSliceList[ichop][idig];
00796         int tdc =  Calibrator::Instance().GetTDCFromTime(cdh.GetTime(CalTimeType::kNone), kQieRcid);    
00797         float sig =  cdh.GetCharge(CalDigitType::kSigCorr);
00798         int t = (tdc-tfirst);
00799         int plane = cdh.GetPlexSEIdAltL().GetPlane();
00800         if(plane<121) {
00801           refSliceHist[ichop]->Fill(t,sig);
00802          
00803           refSliceGraphTdc.push_back(t);
00804           refSliceGraphPlane.push_back(plane);
00805           refSliceGraphE.push_back(sig);
00806           refSliceGraphSlice.push_back(ichop);
00807           refSliceNGraph[ichop]++;
00808         }
00809       }
00810     }
00811 
00812 
00813     std::vector<int> chpRank;
00814     TimeRankHistos(chopHist.size(),chopHist, chpRank);
00815     for(UInt_t i = 0; i< chopHist.size(); i++) {
00816       for(UInt_t j=i; j<chopHist.size(); j++) {
00817         chopHistInt[i]->Add(chopHist[j]);
00818       }
00819       int color = (chpRank[i] % 7) + 1; // Rotate through colors.
00820       chopHist[i] -> SetLineColor(color);
00821       chopHist[i] -> SetFillColor(color);
00822       chopHistInt[i] -> SetLineColor(color);
00823       chopHistInt[i] -> SetFillColor(color);
00824     }
00825     
00826     std::vector<int> refChpRank;
00827     TimeRankHistos(refSliceHist.size(),refSliceHist, refChpRank);
00828     for(UInt_t i = 0; i< refSliceHist.size(); i++) {
00829       for(UInt_t j=i; j<refSliceHist.size(); j++) {
00830         refSliceHistInt[i]->Add(refSliceHist[j]);
00831       }
00832       int color = (refChpRank[i] % 7) + 1; // Rotate through colors.
00833       refSliceHist[i] -> SetLineColor(color);
00834       refSliceHist[i] -> SetFillColor(color);
00835       refSliceHistInt[i] -> SetLineColor(color);
00836       refSliceHistInt[i] -> SetFillColor(color);
00837     }
00838 
00839 
00840     std::vector<int> nuRank;
00841     TimeRankHistos(neutrinos.size(), nuHist, nuRank);
00842     for(UInt_t inu = 0; inu< neutrinos.size(); inu++) {
00843 
00844       for(UInt_t i=inu; i<nuHist.size(); i++) {
00845         nuHistInt[inu]->Add(nuHist[i]);
00846       }
00847       int color = (nuRank[inu] % 7) +1;
00848       nuHist[inu] -> SetLineColor(color);
00849       nuHist[inu] -> SetFillColor(color);
00850       nuHistInt[inu] -> SetLineColor(color);
00851       nuHistInt[inu] -> SetFillColor(color);      
00852     }
00853 
00854     // Make graphs.
00855     std::vector<TGraph*> chopGraphs;
00856     for(UInt_t ichop=0;ichop<chopList.size();ichop++) {
00857       int n = chopNGraph[ichop];
00858       if(n>0) {
00859         TGraph* g = new TGraph(n);
00860         fCleanup.push_back(g);
00861         chopGraphs.push_back(g);
00862         g->SetMarkerStyle(20);
00863         g->SetMarkerColor((chpRank[ichop] % 7) +1);
00864         
00865         Int_t i=0;
00866         for(UInt_t p=0;p<chopGraphTdc.size();p++) {
00867           if(chopGraphChop[p] == (int)ichop) {
00868             g->SetPoint(i,chopGraphTdc[p],chopGraphPlane[p]);
00869             i++;
00870           }
00871         }
00872       }
00873     }
00874 
00875     std::vector<TGraph*> refSliceGraphs;
00876     for(UInt_t ichop=0;ichop<refSliceList.size();ichop++) {
00877       int n = refSliceNGraph[ichop];
00878       if(n>0) {
00879         TGraph* g = new TGraph(n);
00880         fCleanup.push_back(g);
00881         refSliceGraphs.push_back(g);
00882         g->SetMarkerStyle(20);
00883         g->SetMarkerColor((refChpRank[ichop] % 7) +1);  
00884         Int_t i=0;
00885         for(UInt_t p=0;p<refSliceGraphTdc.size();p++) {
00886           if(refSliceGraphSlice[p] == (int)ichop) {
00887             g->SetPoint(i,refSliceGraphTdc[p],refSliceGraphPlane[p]);
00888             i++;
00889           }
00890         }
00891       }
00892     }
00893 
00894     std::vector<TGraph*> nuGraphs;
00895     for(UInt_t inu=0;inu<neutrinos.size();inu++) {
00896       int n = nuNGraph[inu];
00897       if(n>0) {
00898         TGraph* g = new TGraph(n);
00899         fCleanup.push_back(g);
00900         nuGraphs.push_back(g);
00901         g->SetMarkerStyle(20);
00902         g->SetMarkerColor((nuRank[inu] % 7) +1);        
00903         Int_t i=0;
00904         for(UInt_t p=0;p<nuGraphTdc.size();p++) {
00905           if(nuGraphNu[p] == (int)inu) {
00906             g->SetPoint(i,nuGraphTdc[p],nuGraphPlane[p]);
00907             i++;
00908           }
00909         }
00910       }
00911     }
00912     
00913 
00914 
00915     gStyle->SetOptStat(0);
00916 
00917     if(!fCanvas1) fCanvas1 = new TCanvas("TimeCanvas","Time Histograms");
00918     fCanvas1->cd();
00919     fCanvas1->Clear();
00920     fCanvas1->SetLogy(1);
00921     fCanvas1->Divide(1,3,0.001,0.001,kWhite);
00922     
00923     fCanvas1->cd(1);
00924     fCanvas1->GetPad(1)->SetLogy(1);
00925     hitHist->Draw();
00926     for(UInt_t i = 0; i < nuHistInt.size(); i++) {
00927       if(nuHistInt[i]->GetEntries()>0) nuHistInt[i]->Draw("same");
00928     }
00929  
00930     fCanvas1->cd(2);
00931     fCanvas1->GetPad(2)->SetLogy(1);
00932     hitHist->Draw();
00933     for(UInt_t i = 0;i <chopHistInt.size(); i++) {
00934       if(chopHistInt[i]->GetEntries()>0) chopHistInt[i]->Draw("same");
00935     }
00936         
00937     fCanvas1->cd(3);
00938     fCanvas1->GetPad(3)->SetLogy(1);
00939     hitHist->Draw();
00940     for(UInt_t i = 0;i < refSliceHistInt.size(); i++) {
00941       if(refSliceHistInt[i]->GetEntries()>0) refSliceHistInt[i]->Draw("same");
00942     }    
00943 
00944     
00945     if(!fCanvas2) fCanvas2 = new TCanvas("WholeCanvas","Whole Event");
00946     fCanvas2->Clear();
00947     fCanvas2->Divide(1,3,0.001,0.001,kWhite);
00948     fCanvas2->cd(1);
00949     hit2Hist->Draw("colz");
00950     fCanvas2->cd(2);
00951     hitUHist->Draw("colz");
00952     fCanvas2->cd(3);
00953     hitVHist->Draw("colz");
00954 
00955 
00956     if(!fCanvas3) fCanvas3 = new TCanvas("PosTimeCanvas","Position vs Time");
00957     fCanvas3->cd();
00958     fCanvas3->Clear();
00959     fCanvas3->Divide(1,3,0.001,0.001,kWhite);
00960     TH2* h2frame = new TH2F("h2frame","Plane vs Time",600,0,600,130,0,130);
00961     fCleanup.push_back(h2frame);
00962 
00963     
00964     fCanvas3->cd(1);
00965     h2frame->Draw();
00966     for(UInt_t i=0;i<nuGraphs.size();i++) {
00967       nuGraphs[i]->Draw("p");
00968     }
00969 
00970     fCanvas3->cd(2);
00971     h2frame->Draw();
00972     for(UInt_t i=0;i<chopGraphs.size();i++) {
00973       chopGraphs[i]->Draw("p");
00974     }
00975 
00976     fCanvas3->cd(3);
00977     h2frame->Draw();
00978     for(UInt_t i=0;i<refSliceGraphs.size();i++) {
00979       refSliceGraphs[i]->Draw("p");
00980     }
00981 
00982 
00983 
00984   }
00985 
00986   {
00987     fFile->cd();
00988     fTree->AutoSave("SaveSelf Overwrite"); // SaveSelf makes it useable. Overwrite saves time, but is dangerous.
00989     fNuTree->AutoSave("SaveSelf Overwrite");
00990   }
00991   
00992   if(oldDir) oldDir->cd(); // restore old directory.
00993   return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00994 }

const Registry & ChopModule::DefaultConfig (  )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 998 of file ChopModule.cxx.

References MuELoss::e, JobCModule::GetName(), Registry::LockValues(), Registry::Set(), and Registry::UnLockValues().

00999 {
01000   //======================================================================
01001   // Supply the default configuration for the module
01002   //======================================================================
01003   static Registry r; // Default configuration for module
01004   
01005   // Set name of config
01006   std::string name = this->JobCModule::GetName();
01007   name += ".config.default";
01008   r.SetName(name.c_str());
01009   
01010   // Set values in configuration
01011   r.UnLockValues();
01012   r.Set("ChopAlgorithm","AlgChopListFar");
01013   r.Set("ChopAlgConfig","default");
01014   r.Set("ListIn",         "canddigitlist");
01015   r.Set("ListOut",        "candchoplist");
01016   
01017   r.Set("plots",1);
01018   r.Set("eval_sr",0);
01019   r.Set("filename","mychopper.root");
01020   r.Set("particleTimeout",100e-9);
01021 
01022   r.LockValues();
01023 
01024   return r;
01025 }

JobCResult ChopModule::Reco ( MomNavigator mom  )  [virtual]

Implement this for read-write access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 77 of file ChopModule.cxx.

References CandRecord::FindCandHandle(), Form(), AlgFactory::GetAlgHandle(), Registry::GetCharString(), JobCModule::GetConfig(), MomNavigator::GetFragment(), AlgFactory::GetInstance(), CandHandle::GetNDaughters(), Msg::kDebug, JobCResult::kPassed, Msg::kWarning, CandChopList::MakeCandidate(), MSG, CandRecord::SecureCandHandle(), CandContext::SetCandRecord(), CandContext::SetDataIn(), JobCResult::SetFailed(), CandHandle::SetName(), CandHandle::SetTitle(), and JobCResult::SetWarning().

00078 {
00079   JobCResult result = JobCResult::kPassed;
00080 
00081   // config.
00082   Registry& cfg = this->GetConfig();
00083   const char* algName       = cfg.GetCharString("ChopAlgorithm");
00084   const char* algConfigName = cfg.GetCharString("ChopAlgConfig");
00085   const char* listIn = cfg.GetCharString("ListIn");
00086   const char* listOut = cfg.GetCharString("ListOut");
00087 
00088   
00089   // Find PrimaryCandidateRecord fragment in MOM.
00090   CandRecord *candrec = dynamic_cast<CandRecord *>
00091     (mom->GetFragment("CandRecord", "PrimaryCandidateRecord"));
00092   if (candrec == 0) {
00093     MSG("Chop", Msg::kWarning) << "No PrimaryCandidateRecord in MOM."
00094                                << endl;
00095     result.SetWarning().SetFailed();
00096     return result;
00097   }
00098 
00099   CandDigitListHandle *cdlh = dynamic_cast<CandDigitListHandle *>
00100     (candrec->FindCandHandle("CandDigitListHandle", listIn));
00101 
00102   // Require number of CandDigits to be non-zero.
00103   if (!cdlh || cdlh->GetNDaughters() < 1) {
00104     MSG("StripSR", Msg::kDebug)
00105       << "Null CandDigit list.  Bail out of event." << endl;
00106     result.SetFailed();
00107     return result;
00108   }
00109   
00110   AlgFactory &af = AlgFactory::GetInstance();
00111   AlgHandle adlh = af.GetAlgHandle(algName,algConfigName);
00112   CandContext cx(this, mom);
00113   cx.SetCandRecord(candrec);
00114   cx.SetDataIn(cdlh);
00115 
00116   CandChopListHandle chopListH = CandChopList::MakeCandidate(adlh, cx);
00117   chopListH.SetName(listOut);
00118   chopListH.SetTitle(Form("Chop list created by alg %s config %s",
00119                           algName, algConfigName) );
00120   candrec->SecureCandHandle(chopListH);
00121   
00122   
00123   return JobCResult::kPassed; // kNoDecision, kFailed, etc.
00124 }


Member Data Documentation

TCanvas* ChopModule::fCanvas1 [private]

Definition at line 40 of file ChopModule.h.

Referenced by Ana().

TCanvas* ChopModule::fCanvas2 [private]

Definition at line 41 of file ChopModule.h.

Referenced by Ana().

TCanvas* ChopModule::fCanvas3 [private]

Definition at line 42 of file ChopModule.h.

Referenced by Ana().

std::vector<TObject*> ChopModule::fCleanup [private]

Definition at line 46 of file ChopModule.h.

Referenced by Ana().

TFile* ChopModule::fFile [private]

Definition at line 37 of file ChopModule.h.

Referenced by Ana(), and ~ChopModule().

ChopTreeLeaf* ChopModule::fleaf [private]

Definition at line 43 of file ChopModule.h.

Referenced by Ana().

ChopNeutrinoLeaf* ChopModule::fnu [private]

Definition at line 44 of file ChopModule.h.

Referenced by Ana().

TTree* ChopModule::fNuTree [private]

Definition at line 39 of file ChopModule.h.

Referenced by Ana(), and ~ChopModule().

TTree* ChopModule::fTree [private]

Definition at line 38 of file ChopModule.h.

Referenced by Ana(), and ~ChopModule().


The documentation for this class was generated from the following files:
Generated on Mon Aug 11 01:05:40 2014 for loon by  doxygen 1.4.7