ChopEvaluation Class Reference

#include <ChopEvaluation.h>

Inheritance diagram for ChopEvaluation:
ChopNeutrinoLeaf ChopTreeLeaf

List of all members.

Public Member Functions

 ChopEvaluation ()
 match of nus, calorimeter strips
void Reset ()
void Evaluate (const std::vector< CandDigitHandle > &inList, const Truthifier &truth, const std::vector< int > &inNeutrinos, const std::vector< double > &inNeutrinoTZero, double inTCut)

Public Attributes

int fTdcBeg
int fTdcEnd
int fPlaneBeg
int fPlaneEnd
double fSigcor
double fSigcor_cal
double fSigcor_calt
double fSigcor_fid
double fMeanTime
int fBigTdc
double fBigTdcE
int fBigPlane
double fBigPlaneE
int fPlanes
int fStrips
int fCalStrips
int fDigits
int fBestNeutrino1
int fBestNeutrino2
profile_element fProfile [kNProf]
std::vector< double > fTdcProfile
std::vector< double > fPlaneProfile
 Profile in buckets.
std::vector< double > fNuMatch
 Profile in planes.
std::vector< double > fNuMatch_cal
 Fraction of sigcor matching neutrino [].
std::vector< double > fNuMatch_fid
 Match of neutrinos, calorimeter only.
std::vector< double > fNuMatch_calt
 Match of nus, fiducial only.
std::vector< double > fNuMatch_caltfid
 Match of nus, fiducial time cut.
std::vector< double > fNuMatch_strips
 Match of nus, fiducial time and space cut.
std::vector< double > fNuMatch_calstrips
 match of nus, strips

Detailed Description

Definition at line 23 of file ChopEvaluation.h.


Constructor & Destructor Documentation

ChopEvaluation::ChopEvaluation (  ) 

match of nus, calorimeter strips

Definition at line 11 of file ChopEvaluation.cxx.

References Reset().

00011                                :
00012   fNuMatch(50,0),
00013   fNuMatch_cal(50,0),
00014   fNuMatch_fid(50,0),
00015   fNuMatch_calt(50,0),
00016   fNuMatch_caltfid(50,0)
00017 {
00018   Reset();
00019 }


Member Function Documentation

void ChopEvaluation::Evaluate ( const std::vector< CandDigitHandle > &  inList,
const Truthifier truth,
const std::vector< int > &  inNeutrinos,
const std::vector< double > &  inNeutrinoTZero,
double  inTCut 
)

Definition at line 56 of file ChopEvaluation.cxx.

References fBestNeutrino1, fBestNeutrino2, fBigPlane, fBigPlaneE, fBigTdc, fBigTdcE, fCalStrips, fDigits, fMeanTime, fNuMatch, fNuMatch_cal, fNuMatch_calstrips, fNuMatch_calt, fNuMatch_caltfid, fNuMatch_fid, fNuMatch_strips, fPlaneBeg, fPlaneEnd, fPlaneProfile, fPlanes, fProfile, fSigcor, fSigcor_cal, fSigcor_fid, fStrips, fTdcBeg, fTdcEnd, fTdcProfile, PlexSEIdAltL::GetBestSEId(), CandDigitHandle::GetCharge(), PlexSEIdAltL::GetPlane(), PlexPlaneId::GetPlaneView(), CandDigitHandle::GetPlexSEIdAltL(), Truthifier::GetRawDigit(), UgliGeomHandle::GetStripHandle(), RawDigit::GetTDC(), GetVldContext(), profile_element::i, Truthifier::IsDigitFromNeutrino(), kNProf, CalDigitType::kSigCorr, PlaneView::kU, PlaneView::kV, and profile_element::p.

Referenced by ChopModule::Ana().

00063 { 
00064   //
00065   //
00066   //
00067   if(inList.size()==0) return; // Null list.
00068   
00069   UgliGeomHandle ugli(*(inList[0].GetVldContext()));
00070 
00071   fTdcBeg = truth.GetRawDigit(inList[0])->GetTDC();
00072   fTdcEnd = truth.GetRawDigit(inList[0])->GetTDC();
00073   fPlaneBeg = inList[0].GetPlexSEIdAltL().GetPlane();
00074   fPlaneEnd = inList[0].GetPlexSEIdAltL().GetPlane();
00075   fDigits = inList.size();
00076   std::map<PlexStripEndId,int> hitStrips;    
00077   std::map<PlexStripEndId,int>::iterator hitStripsItr;    
00078     
00079 
00080   // First pass. Get start and end times.
00081 
00082   for(UInt_t idig=0;idig<inList.size();idig++) {
00083     CandDigitHandle cdh = inList[idig];
00084     int tdc = truth.GetRawDigit(inList[idig])->GetTDC();
00085     int plane = cdh.GetPlexSEIdAltL().GetPlane();
00086     PlexStripEndId seid = cdh.GetPlexSEIdAltL().GetBestSEId();
00087 
00088     if(tdc<fTdcBeg) fTdcBeg = tdc;
00089     if(tdc>fTdcEnd) fTdcEnd = tdc;
00090     if(plane<fPlaneBeg) fPlaneBeg = plane;
00091     if(plane>fPlaneEnd) fPlaneEnd = plane;
00092     hitStrips[seid]+=1;
00093   }
00094   fStrips = hitStrips.size();
00095   for(hitStripsItr=hitStrips.begin();  hitStripsItr!=hitStrips.end();  hitStripsItr++)
00096     if(hitStripsItr->first.GetPlane()<121) fCalStrips +=1;
00097 
00098   // resize arrays.
00099   fTdcProfile.resize(fTdcEnd-fTdcBeg+1,0);
00100   fPlaneProfile.resize(300,0);
00101 
00102   fNuMatch.        resize(inNeutrinos.size(),(double)0.);
00103   fNuMatch_cal.    resize(inNeutrinos.size(),(double)0.);
00104   fNuMatch_fid.    resize(inNeutrinos.size(),(double)0.);
00105   fNuMatch_calt.   resize(inNeutrinos.size(),(double)0.);
00106   fNuMatch_caltfid.resize(inNeutrinos.size(),(double)0.);
00107   fNuMatch_strips.   resize(inNeutrinos.size(),(double)0.);
00108   fNuMatch_calstrips.resize(inNeutrinos.size(),(double)0.);
00109   
00110   std::vector<std::map<PlexStripEndId,int> >  nuStrips(inNeutrinos.size());     
00111   std::map<PlexStripEndId,int>::iterator stripItr;
00112 
00113 
00114   for(UInt_t idig=0;idig<inList.size();idig++) {
00115     CandDigitHandle cdh = inList[idig];
00116     int tdc = truth.GetRawDigit(cdh)->GetTDC();
00117     float sig = cdh.GetCharge(CalDigitType::kSigCorr);
00118     int plane = cdh.GetPlexSEIdAltL().GetPlane();
00119     PlexStripEndId seid = cdh.GetPlexSEIdAltL().GetBestSEId();
00120     PlaneView::PlaneView_t view = cdh.GetPlexSEIdAltL().GetBestSEId().GetPlaneView();
00121     float tpos = ugli.GetStripHandle(cdh.GetPlexSEIdAltL().GetBestSEId()).GetTPos();
00122     
00123     bool cal = (plane<121);
00124     bool fid = false;
00125     if(plane>20&&plane<90) {
00126       if(  ( (view==PlaneView::kU) && (tpos > -0.3) && (tpos <  2.4) )  ||
00127            ( (view==PlaneView::kV) && (tpos > -2.4) && (tpos <  0.3) ) ) {
00128         fid = true;
00129       }
00130     }
00131     
00132     
00133     fSigcor += sig;
00134     if(cal) fSigcor_cal += sig;
00135     if(fid) fSigcor_fid += sig;
00136 
00137     fMeanTime = fMeanTime + sig*(double)tdc;
00138     
00139     fTdcProfile[tdc-fTdcBeg] += sig;
00140     fPlaneProfile[plane] += sig;
00141 
00142     for(UInt_t inu=0;inu<inNeutrinos.size();inu++) {
00143       int neu = inNeutrinos[inu];
00144       float frac  = truth.IsDigitFromNeutrino(neu,cdh);//,neuTrueStartTime[inu]+fParticleTimeout);        
00145       float fract = truth.IsDigitFromNeutrino(neu,cdh,
00146                                               inNeutrinoTZero[inu]+inTCut);//,neuTrueStartTime[inu]+fParticleTimeout);    
00147       
00148       fNuMatch[inu]+=frac*sig;
00149       if(cal) fNuMatch_cal[inu]   += frac*sig;
00150       if(fid) fNuMatch_fid[inu]   += frac*sig;
00151       if(cal) fNuMatch_calt[inu]    += fract*sig;
00152       if(fid) fNuMatch_caltfid[inu] += fract*sig;
00153 
00154       if(fract>0) nuStrips[inu][seid]++;
00155     }
00156 
00157     
00158   }
00159 
00160   //
00161   // Now finish evaluation..
00162   //
00163 
00164   fMeanTime = fMeanTime/fSigcor;
00165 
00166   // Loop on time buckets:
00167   for(UInt_t itdc=0; itdc<fTdcProfile.size(); itdc++) {
00168     int tdc = itdc+fTdcBeg;
00169 
00170     if(fTdcProfile[itdc]>fBigTdcE) {
00171       fBigTdcE = fTdcProfile[itdc];
00172       fBigTdc  = tdc;
00173     }
00174   }
00175 
00176   // Create profile.
00177   for(UInt_t itdc=0; itdc<fTdcProfile.size(); itdc++) {
00178     int tdc = itdc+fTdcBeg;
00179     int i = tdc - fBigTdc;
00180     int elem = i+5;
00181     if( (elem>=0) &&(elem<kNProf) ) {      
00182       fProfile[elem].p = fTdcProfile[itdc];
00183       fProfile[elem].i = elem;
00184     }
00185   }
00186   
00187   // Loop on planes:
00188   for(UInt_t p=0;p<fPlaneProfile.size();p++) {
00189     if(fPlaneProfile[p]>fBigPlaneE) {
00190       fBigPlaneE = fPlaneProfile[p];
00191       fBigPlane  = p;
00192     }
00193     if(fPlaneProfile[p]>0) fPlanes++;
00194   }
00195 
00196   // Loop on neutrinos:
00197   for(UInt_t inu=0;inu<inNeutrinos.size();inu++) {
00198     for(stripItr=nuStrips[inu].begin(); stripItr!=nuStrips[inu].end(); stripItr++) {
00199       fNuMatch_strips[inu] += 1;
00200       if(stripItr->first.GetPlane()<121) 
00201         fNuMatch_calstrips[inu] += 1;
00202     }
00203   }
00204 
00205   
00206   fBestNeutrino1 = -1;
00207   fBestNeutrino2 = -1;
00208   double best_size = 0;
00209   double best_size2 = 0;
00210   for(UInt_t inu=0;inu<inNeutrinos.size();inu++) {
00211     if(fNuMatch_calt[inu]>best_size) {
00212       fBestNeutrino1 = inu;
00213       best_size = fNuMatch_calt[inu];
00214     }
00215   }
00216    
00217   for(UInt_t inu=0;inu<inNeutrinos.size();inu++) {
00218     if(
00219        (fNuMatch_calt[inu]>best_size2)
00220        &&((int)inu!=fBestNeutrino1)
00221        ) {
00222       fBestNeutrino2 = inu;
00223       best_size2 = fNuMatch_calt[inu];
00224     }
00225   }
00226 }

void ChopEvaluation::Reset (  ) 

Reimplemented in ChopNeutrinoLeaf, and ChopTreeLeaf.

Definition at line 22 of file ChopEvaluation.cxx.

References fBestNeutrino1, fBestNeutrino2, fBigPlane, fBigPlaneE, fBigTdc, fBigTdcE, fCalStrips, fMeanTime, fPlanes, fProfile, fSigcor, fSigcor_cal, fSigcor_fid, fStrips, fTdcBeg, fTdcEnd, profile_element::i, kNProf, and profile_element::p.

Referenced by ChopEvaluation().

00023 {
00024   fTdcBeg = -1;
00025   fTdcEnd = -1;; 
00026   fSigcor = 0;
00027   fSigcor_cal = 0;
00028   fSigcor_fid = 0; 
00029   fMeanTime = 0; 
00030   fBigTdc = 0; 
00031   fBigTdcE = 0; 
00032   fBigPlane = 0; 
00033   fBigPlaneE = 0; 
00034   fPlanes = 0; 
00035   fStrips = 0;
00036   fCalStrips = 0;
00037   fBestNeutrino1 = -1;
00038   fBestNeutrino2 = -1;
00039 
00040   for(int i=0;i<kNProf;i++) {
00041     fProfile[i].i=i;
00042     fProfile[i].p=0;
00043   }
00044   /*
00045   fTdcProfile.clear();
00046   fPlaneProfile.clear();
00047   fNuMatch.clear();
00048   fNuMatch_cal.clear();
00049   fNuMatch_fid.clear();
00050   fNuMatch_calt.clear();
00051   fNuMatch_caltfid.clear();
00052   fStrips.clear();
00053   */
00054 }


Member Data Documentation

Definition at line 45 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 46 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 38 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 39 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 36 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 37 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 42 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 43 of file ChopEvaluation.h.

Referenced by Evaluate().

Definition at line 35 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

std::vector<double> ChopEvaluation::fNuMatch

Profile in planes.

Definition at line 53 of file ChopEvaluation.h.

Referenced by ChopModule::Ana(), and Evaluate().

std::vector<double> ChopEvaluation::fNuMatch_cal

Fraction of sigcor matching neutrino [].

Definition at line 54 of file ChopEvaluation.h.

Referenced by ChopModule::Ana(), and Evaluate().

match of nus, strips

Definition at line 59 of file ChopEvaluation.h.

Referenced by ChopModule::Ana(), and Evaluate().

std::vector<double> ChopEvaluation::fNuMatch_calt

Match of nus, fiducial only.

Definition at line 56 of file ChopEvaluation.h.

Referenced by ChopModule::Ana(), and Evaluate().

std::vector<double> ChopEvaluation::fNuMatch_caltfid

Match of nus, fiducial time cut.

Definition at line 57 of file ChopEvaluation.h.

Referenced by ChopModule::Ana(), and Evaluate().

std::vector<double> ChopEvaluation::fNuMatch_fid

Match of neutrinos, calorimeter only.

Definition at line 55 of file ChopEvaluation.h.

Referenced by ChopModule::Ana(), and Evaluate().

std::vector<double> ChopEvaluation::fNuMatch_strips

Match of nus, fiducial time and space cut.

Definition at line 58 of file ChopEvaluation.h.

Referenced by ChopModule::Ana(), and Evaluate().

Definition at line 28 of file ChopEvaluation.h.

Referenced by Evaluate().

Definition at line 29 of file ChopEvaluation.h.

Referenced by Evaluate().

std::vector<double> ChopEvaluation::fPlaneProfile

Profile in buckets.

Definition at line 52 of file ChopEvaluation.h.

Referenced by Evaluate().

Definition at line 40 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 48 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 31 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 32 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 33 of file ChopEvaluation.h.

Definition at line 34 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 41 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 26 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

Definition at line 27 of file ChopEvaluation.h.

Referenced by Evaluate(), and Reset().

std::vector<double> ChopEvaluation::fTdcProfile

Definition at line 51 of file ChopEvaluation.h.

Referenced by Evaluate().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1