ANtpTrackInfoAna Class Reference

#include <ANtpTrackInfoAna.h>

Inheritance diagram for ANtpTrackInfoAna:
NueAnaBase

List of all members.

Public Member Functions

 ANtpTrackInfoAna (ANtpTrackInfoNue &anti)
virtual ~ANtpTrackInfoAna ()
void Analyze (int evtn, RecRecordImp< RecCandHeader > *srobj)
void FillNueTrackInformation (NtpSRTrack *ntpTrack, NtpSREvent *ntpEvent, ANtpTrackInfoNue *trackInfoNue)
void DetermineSigInOut (NtpSRTrack *ntpTrack, RecRecordImp< RecCandHeader > *srobj)
Bool_t IsFidAll (NtpSRTrack *ntpTrack)
Float_t RecoMuEnergy (SimFlag::SimFlag_t s, const Detector::Detector_t det)
Float_t RecoMuEnergyNew (VldContext cx, EnergyCorrections::WhichCorrection_t corrver=EnergyCorrections::kDefault)

Private Attributes

Int_t fDetectorType
ANtpTrackInfoNuefANtpTrackInfo
ANtpInfoObjectFillerfInfoFiller

Detailed Description

Definition at line 12 of file ANtpTrackInfoAna.h.


Constructor & Destructor Documentation

ANtpTrackInfoAna::ANtpTrackInfoAna ( ANtpTrackInfoNue anti  ) 

Definition at line 18 of file ANtpTrackInfoAna.cxx.

00018                                                         :
00019    fANtpTrackInfo(anti)
00020 {}

ANtpTrackInfoAna::~ANtpTrackInfoAna (  )  [virtual]

Definition at line 22 of file ANtpTrackInfoAna.cxx.

00023 {
00024 
00025 }


Member Function Documentation

void ANtpTrackInfoAna::Analyze ( int  evtn,
RecRecordImp< RecCandHeader > *  srobj 
) [virtual]

Implements NueAnaBase.

Definition at line 28 of file ANtpTrackInfoAna.cxx.

References VertexHelper::CalculateNTrkLike(), DetermineSigInOut(), fANtpTrackInfo, fDetectorType, FillNueTrackInformation(), ANtpInfoObjectFiller::FillTrackInformation(), fInfoFiller, VldContext::GetDetector(), ANtpEventManipulator::GetEvent(), ANtpRecoNtpManipulator::GetEventManipulator(), RecRecordImp< T >::GetHeader(), AtNuAnaUtil::GetPrimaryTrack(), ANtpRecoNtpManipulator::GetStripArray(), RecHeader::GetVldContext(), ReleaseType::IsBirch(), ReleaseType::IsCedar(), ReleaseType::IsDogwood(), IsFidAll(), EnergyCorrections::kBirch, EnergyCorrections::kCedar, EnergyCorrections::kDogwood, NtpSRTrack::momentum, ANtpTrackInfoNue::muonEnergyMethod, NtpSRTrackPlane::ntrklike, ANtpTrackInfoNue::phCCGeV, NtpSRTrack::plane, NtpSRMomentum::qp, RecoMuEnergyNew(), NueAnaBase::release, EnergyCorrections::SetCorrectionVersion(), ANtpEventManipulator::SetEventInSnarl(), ANtpRecoNtpManipulator::SetPrimaryTrackCriteria(), ANtpInfoObjectFiller::SetStripArray(), Munits::sr, ANtpTrackInfoNue::trklikePlanes, and ANtpTrackInfoNue::trklikeRatio.

Referenced by VtxRecordAna::FillReco(), and NueRecordAna::FillReco().

00029 {
00030   if(srobj==0){
00031     return;
00032   }
00033   if(((dynamic_cast<NtpStRecord *>(srobj))==0)&&
00034      ((dynamic_cast<NtpSRRecord *>(srobj))==0)){
00035     return;
00036   }
00037 
00038   NtpSREvent *event =0;
00039   NtpSRTrack *track = 0;
00040 
00041   const RecCandHeader *ntpHeader = &(srobj->GetHeader());
00042   VldContext vc = ntpHeader->GetVldContext();
00043   fDetectorType = ntpHeader->GetVldContext().GetDetector();
00044   //SimFlag::SimFlag_t s = ntpHeader->GetVldContext().GetSimFlag();
00045 
00046   //and now an ugly bit of code to deal with either NtpStRecord or NtpSRRecord
00047   bool foundst=false;
00048   NtpStRecord *st=dynamic_cast<NtpStRecord *>(srobj);
00049   fInfoFiller = new ANtpInfoObjectFiller();
00050 
00051   ANtpRecoNtpManipulator *ntpManipulator = 0;
00052   NtpSRRecord *sr = 0;
00053                                                                                 
00054   if(st != 0){
00055       foundst = true;
00056       ntpManipulator = new ANtpRecoNtpManipulator(st);
00057   }
00058   else{
00059       sr = dynamic_cast<NtpSRRecord *>(srobj);
00060       ntpManipulator = new ANtpRecoNtpManipulator(sr);
00061   }
00062 
00063   if(ReleaseType::IsDogwood(release))
00064      SetCorrectionVersion(EnergyCorrections::kDogwood);
00065   if(ReleaseType::IsCedar(release))
00066      SetCorrectionVersion(EnergyCorrections::kCedar);
00067   if(ReleaseType::IsBirch(release))
00068      SetCorrectionVersion(EnergyCorrections::kBirch);
00069                                                                                 
00070   fInfoFiller->SetStripArray(ntpManipulator->GetStripArray());
00071   //set up which flags you want to use to determine the primary shower or track
00072   //a value of 0 for a flag means it will not be used
00073   ntpManipulator->SetPrimaryTrackCriteria(0,1,0); // nplanes, length, total pulse height
00074   //get the primary track for the event - if no track is present it
00075   //returns 0
00076   ANtpEventManipulator * ntpEventManipulator =
00077                            ntpManipulator->GetEventManipulator();
00078                                                                                           
00079   ntpEventManipulator->SetEventInSnarl(evtn);
00080   event = ntpEventManipulator->GetEvent();
00081   track = SntpHelpers::GetPrimaryTrack(evtn, st);
00082   
00083   if(track){ 
00084 //          Fill information from the base ANtpTrackInfo  
00085       fInfoFiller->FillTrackInformation(track, &fANtpTrackInfo);
00086 //          Fill information specific to the ANtpTrackInfoNue class
00087 
00088      int ntrklike = track->plane.ntrklike;
00089      if(ReleaseType::IsCedar(release)){
00090        ntrklike = VertexHelper::CalculateNTrkLike(track, st);
00091      }
00092      fANtpTrackInfo.trklikePlanes = ntrklike;
00093                                                                                 
00094      if(event->plane.n){
00095         fANtpTrackInfo.trklikeRatio= static_cast<Float_t>(ntrklike)/static_cast<Float_t>(event->plane.n);
00096      }
00097 
00098       FillNueTrackInformation(track, event, &fANtpTrackInfo);
00099       DetermineSigInOut(track, srobj);
00100   
00101       bool IsCont = (IsFidAll(track) || track->momentum.qp==0);
00102       Int_t Method  = 0;
00103       if(IsCont) Method = 2; //stoppers use range
00104       else Method = 1; //Punch Through -> use curvature
00105       if(track->momentum.qp == 0) Method = 2;
00106       fANtpTrackInfo.muonEnergyMethod = Method;
00107 
00108       fANtpTrackInfo.phCCGeV = RecoMuEnergyNew(vc);
00109   }
00110 
00111   if(fInfoFiller){
00112     delete fInfoFiller;
00113     fInfoFiller=0;
00114   }
00115 
00116   if(ntpManipulator){
00117     delete ntpManipulator;
00118     ntpManipulator=0;
00119   }
00120 
00121 }

void ANtpTrackInfoAna::DetermineSigInOut ( NtpSRTrack ntpTrack,
RecRecordImp< RecCandHeader > *  srobj 
)

Definition at line 140 of file ANtpTrackInfoAna.cxx.

References fANtpTrackInfo, fDetectorType, VHS::GetStrip(), SntpHelpers::GetStripIndex(), NueConvention::InPartialRegion(), Detector::kFar, Detector::kNear, NtpSRStripPulseHeight::mip, NtpSRTrack::nstrip, NtpSRTrack::ph, NtpSRStrip::plane, NtpSRTrack::stpph0mip, NtpSRTrack::stpph1mip, NtpSRStrip::strip, ANtpTrackInfoNue::trackSignalFull, and ANtpTrackInfoNue::trackSignalPartial.

Referenced by Analyze().

00140                                                                                                 {
00141   // compute the amount of signal in the partially instrumented region
00142   // and the amount in the fully instrumented region
00143   //
00144   // this region is defined as:
00145   // v planes: (strip<=4 || strip>=67)
00146   // partial u: (strip==0 || strip=63)
00147   // full u: (strip<=26 || strip>=88)
00148                                                                                 
00149   Float_t sigfull,sigpart;
00150   sigfull=sigpart=0;
00151                                                                                 
00152   // loop over all strips in the event
00153   // and sum the signals in the partial and full regions
00154   if(fDetectorType == Detector::kNear){
00155     for(int i=0; i<ntpTrack->nstrip; i++){
00156       Int_t index = SntpHelpers::GetStripIndex(i,ntpTrack);
00157       NtpSRStrip *ntpStrip = SntpHelpers::GetStrip(index,srobj);
00158       if(ntpStrip==0) continue;
00159       Int_t pr = NueConvention::InPartialRegion(ntpStrip->plane, ntpStrip->strip);
00160       float charge =  ntpTrack->stpph1mip[i] + ntpTrack->stpph0mip[i];
00161       if(pr==1)      {  sigpart += charge; }
00162       else if(pr==-1){  sigfull += charge; }
00163     }
00164   }
00165                                                                                 
00166   if(fDetectorType == Detector::kFar)
00167     sigfull = ntpTrack->ph.mip;
00168 
00169   fANtpTrackInfo.trackSignalFull = sigfull;
00170   fANtpTrackInfo.trackSignalPartial = sigpart;
00171 }

void ANtpTrackInfoAna::FillNueTrackInformation ( NtpSRTrack ntpTrack,
NtpSREvent ntpEvent,
ANtpTrackInfoNue trackInfoNue 
)

Definition at line 124 of file ANtpTrackInfoAna.cxx.

References NtpSRPlane::begu, NtpSRPlane::begv, ANtpTrackInfoNue::deltaUVVtx, NueAnaBase::MeuPerGeV, NtpSRStripPulseHeight::mip, NtpSRTrack::ph, NtpSREvent::ph, ANtpTrackInfoNue::phMeu, ANtpTrackInfoNue::phMip, ANtpTrackInfoNue::phNueGeV, NtpSRTrack::plane, and ANtpTrackInfoNue::pulseHeightRatio.

Referenced by Analyze().

00125 {
00126     if(ntpEvent->ph.mip){
00127         trackInfoNue->pulseHeightRatio=ntpTrack->ph.mip/ntpEvent->ph.mip; 
00128     }
00129 
00130     trackInfoNue->phMeu = ntpTrack->ph.mip;
00131     trackInfoNue->phMip = ntpTrack->ph.mip;    
00132     trackInfoNue->phNueGeV = trackInfoNue->phMip/MeuPerGeV;
00133 
00134     trackInfoNue->deltaUVVtx = TMath::Abs(ntpTrack->plane.begu - ntpTrack->plane.begv);
00135     
00136 
00137     return;
00138 }

Bool_t ANtpTrackInfoAna::IsFidAll ( NtpSRTrack ntpTrack  ) 

Definition at line 174 of file ANtpTrackInfoAna.cxx.

References NtpSRTrack::end, fDetectorType, Detector::kNear, NtpSRVertex::plane, NtpSRVertex::x, NtpSRVertex::y, and NtpSRVertex::z.

Referenced by Analyze().

00174                                                      {
00175                                                         
00176   if(ntpTrack == 0) return false;
00177  
00178   float x = ntpTrack->end.x;
00179   float y = ntpTrack->end.y;
00180   float z = ntpTrack->end.z;
00181 
00182  // new definition - coil hole cuts removed for cedar
00183   if(fDetectorType ==Detector::kNear) {//near det
00184     if (!(z<15   &&
00185           x<2.7  && x>-1.65 &&
00186           y<1.65 && y>-1.65 &&
00187           y>(-x)-1.65 && y< x+1.65   &&
00188           y<(-x)+3.55 && y>x-3.55)) 
00189       {return false;}
00190   }
00191   else if(pow(x,2)+pow(y,2)>14 || ntpTrack->end.plane>475 
00192            || ntpTrack->end.plane<5) return false;
00193 
00194   return true;
00195 }

Float_t ANtpTrackInfoAna::RecoMuEnergy ( SimFlag::SimFlag_t  s,
const Detector::Detector_t  det 
)

Definition at line 198 of file ANtpTrackInfoAna.cxx.

References EnergyCorrections::CorrectMomentumFromRange(), EnergyCorrections::CorrectSignedMomentumFromCurvature(), fANtpTrackInfo, ANtpTrackInfo::fitMomentum, ANtpDefaultValue::IsDefault(), SimFlag::kData, ANtpTrackInfoNue::muonEnergyMethod, and ANtpTrackInfo::rangeMomentum.

00199 {
00200   const float mumass=0.10566; // GeV
00201 
00202   bool isdata = (s == SimFlag::kData);
00203   int opt = fANtpTrackInfo.muonEnergyMethod;
00204 
00205   if(!ANtpDefVal::IsDefault(fANtpTrackInfo.muonEnergyMethod)){
00206      float mr= fANtpTrackInfo.rangeMomentum;
00207      float mc= fANtpTrackInfo.fitMomentum;
00208 
00209      mr=CorrectMomentumFromRange(mr,isdata,det);
00210      mc=CorrectSignedMomentumFromCurvature(mc,isdata,det);
00211 
00212     if(opt==0){
00213       //return the most appropriate measure of momentum
00214       // assign opt based on our choice
00215     }
00216     else if(opt==1) { //return curvature measurement
00217         if(fANtpTrackInfo.fitMomentum > 10000.0) return 10000.0;
00218         else return sqrt(mc*mc + mumass*mumass);
00219     }
00220     else if(opt==2) //return range measurement
00221       return sqrt(mr*mr + mumass*mumass);
00222     else return 0;
00223   }
00224   return 0.;
00225 }

Float_t ANtpTrackInfoAna::RecoMuEnergyNew ( VldContext  cx,
EnergyCorrections::WhichCorrection_t  corrver = EnergyCorrections::kDefault 
)

Definition at line 227 of file ANtpTrackInfoAna.cxx.

References fANtpTrackInfo, ANtpTrackInfo::fitMomentum, EnergyCorrections::FullyCorrectMomentumFromRange(), EnergyCorrections::FullyCorrectSignedMomentumFromCurvature(), EnergyCorrections::kDefault, ANtpTrackInfoNue::muonEnergyMethod, ANtpTrackInfo::rangeMomentum, and NueAnaBase::release.

Referenced by Analyze().

00227                                                                                                    {
00228 
00229   // using the new version of energy corrections developed for Cedar/Daikon
00230   corrver = EnergyCorrections::kDefault;
00231 
00232   const float mumass=0.10566;
00233   int method = fANtpTrackInfo.muonEnergyMethod;
00234 
00235   float mr= fANtpTrackInfo.rangeMomentum;
00236   float mc= fANtpTrackInfo.fitMomentum;
00237 
00238   if(mr>0) mr=FullyCorrectMomentumFromRange(mr,cx,release,corrver);
00239   mc=FullyCorrectSignedMomentumFromCurvature(mc,cx,release,corrver);
00240 
00241   if(method == 2) {
00242      return sqrt(mr*mr+ mumass*mumass);
00243   }
00244   if(method == 1){
00245       if(fANtpTrackInfo.fitMomentum > 10000.0) return 10000.0;
00246       else return sqrt(mc*mc+ mumass*mumass);
00247   }
00248   
00249   return 0.;
00250 }


Member Data Documentation

Definition at line 33 of file ANtpTrackInfoAna.h.

Referenced by Analyze(), DetermineSigInOut(), RecoMuEnergy(), and RecoMuEnergyNew().

Definition at line 31 of file ANtpTrackInfoAna.h.

Referenced by Analyze(), DetermineSigInOut(), and IsFidAll().

Definition at line 34 of file ANtpTrackInfoAna.h.

Referenced by Analyze().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1