Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ANtpInfoObjectFillerNC Class Reference

#include <ANtpInfoObjectFillerNC.h>

Inheritance diagram for ANtpInfoObjectFillerNC:

ANtpInfoObjectFillerBeam ANtpInfoObjectFiller List of all members.

Public Member Functions

 ANtpInfoObjectFillerNC ()
 ANtpInfoObjectFillerNC (Detector::Detector_t detector)
virtual ~ANtpInfoObjectFillerNC ()
bool FillInformation (int event, ANtpRecoNtpManipulator *ntpManipulator, ANtpEventInfoNC *eventInfo, ANtpTrackInfoNC *trackInfo, ANtpShowerInfoNC *showerInfo, ANtpTruthInfoBeam *truthInfo)
void SetDetector (Detector::Detector_t detector)
void SetClusterArray (const TClonesArray *clusters)
void InitializekNN (ANtpRecoNtpManipulator *ntpManipulator)

Private Member Functions

void FillEventInformation (ANtpRecoNtpManipulator *ntpManipulator, NtpSREvent *ntpEvent, ANtpEventInfoNC *eventInfo)
void FillTrackInformation (ANtpRecoNtpManipulator *ntpManipulator, NtpSRTrack *ntpTrack, NtpSREvent *ntpEvent, ANtpTrackInfoNC *trackInfo, ANtpEventInfoNC *eventInfo)
void FillShowerInformation (NtpSRShower *ntpShower, ANtpShowerInfoNC *showerInfo, ANtpEventInfoNC *eventInfo)
void FillCrossOverInformation (NtpSRTrack *ntpTrack, NtpSRShower *ntpShower, NtpSREvent *ntpEvent, ANtpRecoNtpManipulator *ntpManipulator, ANtpTrackInfoNC *trackInfo, ANtpShowerInfoNC *showerInfo, ANtpEventInfoNC *eventInfo)
void FillMCInformation (NtpMCTruth *ntpMCTruth, TClonesArray *stdHepArray, ANtpTruthInfoBeam *truthInfo)
void FillStripToPixelMaps ()
void ResetXTalkArrays ()
void FillPlanePixelSignalArrays (NtpSREvent *ntpEvent)
Float_t FindNearestNeighborPixelSignal (Int_t plane, Int_t pixel, Int_t pmt, Float_t planePixelSignal[][64][2])
void FindXTalkStrips (NtpSREvent *ntpEvent)
void FindEarlyActivityWeight (NtpSREvent *ntpEvent, ANtpEventInfoNC *eventInfo)
void GetEvtVtxWithFixup (ANtpRecoNtpManipulator *ntpManipulator, int &vtxPlane, float &vtxZ) const
 Helper for FillEventTimingAndActivityInformation.
void GetStripEventTime (const NtpSREvent *ntpEvent, int vtxPlane, float vtxZ, double &evtTime, double &ToFCorrectedEvtTime) const
 Helper for FillEventTimingAndActivityInformation.
void FillEventTimingAndActivityInformation (ANtpRecoNtpManipulator *ntpManipulator, int event, ANtpEventInfoNC *eventInfo)

Private Attributes

Int_t fPlaneToPMTMapWest [486]
Int_t fPlaneToPMTMapEast [486]
Int_t fStripToPixelMapWest [192]
Int_t fStripToPixelMapEast [192]
Int_t fStripToPixelMapNearU1 [64]
Int_t fStripToPixelMapNearV1 [64]
Int_t fStripToPixelMapNearU2 [64]
Int_t fStripToPixelMapNearV2 [64]
Int_t fStripToPixelMapNearU3 [64]
Int_t fStripToPixelMapNearV3 [64]
Float_t fPlanePixelEastSignal [486][64][2]
Float_t fPlanePixelWestSignal [486][64][2]
Int_t fStripIsXTalkWest [486][192]
Int_t fStripIsXTalkEast [486][192]
Int_t fPlaneCoverage [486]
Anp::InterfacefAnpInterface
const TClonesArray * fClusterArray
bool fkNNSet
int fVHSPlanes
int fVHSStrips
std::vector< double > fAvgCCe
std::vector< double > fAvgCCmu
std::vector< double > fAvgCCtau
std::vector< double > fAvgNC
std::vector< double > fPCCe
std::vector< double > fPCCmu
std::vector< double > fPCCtau
std::vector< double > fPNC
std::vector< double > fVarCCe
std::vector< double > fVarCCmu
std::vector< double > fVarCCtau
std::vector< double > fVarNC

Constructor & Destructor Documentation

ANtpInfoObjectFillerNC::ANtpInfoObjectFillerNC  ) 
 

Definition at line 70 of file ANtpInfoObjectFillerNC.cxx.

References MSG.

00070                                                :
00071   // ANtpInfoObjectFillerBeam(Detector::kUnknown),
00072   ANtpInfoObjectFillerBeam(Detector::kNear),
00073   fClusterArray(0),
00074   fkNNSet(false),
00075   fVHSPlanes(20),
00076   fVHSStrips(20)
00077 {
00078   MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
00079     << "ANtpInfoObjectFillerNC::Default Constructor" << endl;
00080 
00081   FillStripToPixelMaps();
00082 
00083 }

ANtpInfoObjectFillerNC::ANtpInfoObjectFillerNC Detector::Detector_t  detector  ) 
 

Definition at line 86 of file ANtpInfoObjectFillerNC.cxx.

References FillStripToPixelMaps(), and MSG.

00086                                                                           :
00087   ANtpInfoObjectFillerBeam(detector),
00088   fClusterArray(0),
00089   fkNNSet(false),
00090   fVHSPlanes(20),
00091   fVHSStrips(20)
00092 {
00093   MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
00094     << "ANtpInfoObjectFillerNC::Constructor" << endl;
00095 
00096   FillStripToPixelMaps();
00097 
00098 }

ANtpInfoObjectFillerNC::~ANtpInfoObjectFillerNC  )  [virtual]
 

Definition at line 101 of file ANtpInfoObjectFillerNC.cxx.

00102 {
00103   if(fAnpInterface) delete fAnpInterface;
00104 }


Member Function Documentation

void ANtpInfoObjectFillerNC::FillCrossOverInformation NtpSRTrack ntpTrack,
NtpSRShower ntpShower,
NtpSREvent ntpEvent,
ANtpRecoNtpManipulator ntpManipulator,
ANtpTrackInfoNC trackInfo,
ANtpShowerInfoNC showerInfo,
ANtpEventInfoNC eventInfo
[private]
 

Definition at line 1092 of file ANtpInfoObjectFillerNC.cxx.

References ANtpEventInfoNC::aPh3_ns, ANtpEventInfoNC::aPh6_ns, ANtpEventInfoNC::aPhcommon_ns, ANtpEventInfoNC::aPhlast_ns, NtpSRPlane::beg, ANtpRecoNtpManipulator::GetEventManipulator(), ANtpEventManipulator::GetPrimaryTrackNS(), ANtpDefaultValue::IsDefault(), ANtpTrackInfo::length, NtpSREvent::nshower, NtpSREvent::nstrip, NtpSRTrack::nstrip, NtpSRShower::nstrip, NtpSREvent::ntrack, NtpSRStrip::ph0, NtpSRStrip::ph1, NtpSRStrip::plane, NtpSREvent::plane, ANtpTrackInfo::planes, ANtpShowerInfo::planes, NtpSRPulseHeight::sigcor, NtpSREvent::stp, NtpSRTrack::stp, NtpSRShower::stp, NtpSRStrip::strip, ANtpEventInfoNC::trackExtension, and ANtpEventInfoNC::trackStripsInShower.

Referenced by FillInformation().

01099 {
01100 
01101   Int_t indexShowerStrip = 0;
01102   Int_t indexTrackStrip = 0;
01103 
01104   eventInfo->trackStripsInShower = 0;
01105   eventInfo->trackExtension = 0;
01106 
01107   if(ntpShower && ntpTrack && trackInfo->length < 50.){
01108     for(Int_t ns = 0; ns < ntpShower->nstrip; ++ns){
01109 
01110       //get the index for this strip
01111       indexShowerStrip = ntpShower->stp[ns];
01112 
01113       //loop over the track strips
01114       for(Int_t nt = 0; nt < ntpTrack->nstrip; ++nt){
01115 
01116         indexTrackStrip = ntpTrack->stp[nt];
01117 
01118         //check to see if the shower index matches the track index, if so,
01119         //increment the counter for the number of track strips in the shower
01120         if(indexTrackStrip == indexShowerStrip) ++eventInfo->trackStripsInShower;
01121 
01122       }//end loop over track strips
01123 
01124     }//end loop over shower strips
01125 
01126     if(ANtpDefaultValue::IsDefault(showerInfo->planes) ||
01127        ANtpDefaultValue::IsDefault(trackInfo->planes) )
01128       eventInfo->trackExtension = ANtpDefaultValue::kInt;
01129     else
01130       eventInfo->trackExtension = showerInfo->planes - trackInfo->planes;
01131   }//end if shower and track are both present and track length < 50. m
01132 
01133   //fill niki's variables
01134   Int_t    ssind,ssplind;
01135   Double_t ssphtot;
01136   Bool_t   foundshw,foundtrk;
01137 
01138   Int_t planes = ntpEvent->plane.beg;
01139 
01140   Double_t ph3,ph6,phlast,phcommon,phnowere,hitcommon,hitnowere;
01141   ph3=0.;ph6=0.;phlast=0.;phcommon=0.;phnowere=0.;hitcommon=0.;hitnowere=0.;
01142 
01143   NtpSRTrack  *ntpTrackNS = ntpManipulator->GetEventManipulator()->GetPrimaryTrackNS();
01144 
01145   // loop over strips to compute ph3 ph6 phlast phcommon
01146   for(Int_t evss=0;evss<ntpEvent->nstrip;evss++){
01147     Int_t stp_index=((ntpEvent->stp)[evss]);
01148 
01149     if(stp_index!=-1){
01150 
01151      NtpSRStrip *ntpStrip = dynamic_cast<NtpSRStrip *>(fStripArray->At(stp_index));
01152      if(!ntpStrip) continue;
01153      ssind   = ntpStrip->strip;
01154      ssplind = ntpStrip->plane;
01155      ssphtot = ntpStrip->ph1.sigcor+ntpStrip->ph0.sigcor;
01156 
01157      foundshw=false;
01158      foundtrk=false;
01159 
01160      Double_t phstrips=0;
01161      Double_t phstript=0;
01162     // shower strips
01163      Int_t sshwind,sshwplind;
01164      Double_t sshwphtot;
01165 
01166     if(ntpEvent->nshower > 0) {
01167       for(Int_t jj=0;jj<ntpShower->nstrip;jj++){
01168        Int_t stp_indexs=((ntpShower->stp)[jj]);
01169 
01170        if(stp_indexs!=-1){
01171 
01172         NtpSRStrip *ntpStrip1 = dynamic_cast<NtpSRStrip *>(fStripArray->At(stp_indexs));
01173         if(!foundshw){
01174           sshwind   =ntpStrip1->strip;
01175           sshwplind =ntpStrip1->plane;
01176           sshwphtot =ntpStrip1->ph1.sigcor+ntpStrip1->ph0.sigcor;
01177           if(sshwind==ssind && sshwplind==ssplind) {
01178             foundshw=true;
01179             phstrips=sshwphtot;
01180           }
01181         }
01182        }
01183       }
01184     }
01185     // tracks strips
01186     Int_t strkind,strkplind;
01187     Double_t strkphtot;
01188 
01189     if(ntpEvent->ntrack > 0) {
01190 
01191       for(Int_t jj=0;jj<ntpTrackNS->nstrip;jj++){
01192         Int_t stp_indext=((ntpTrackNS->stp)[jj]);
01193 
01194         if(stp_indext!=-1){
01195 
01196         NtpSRStrip *ntpStript = dynamic_cast<NtpSRStrip *>(fStripArray->At(stp_indext));
01197 
01198         if(!foundtrk){
01199           strkind  =ntpStript->strip;
01200           strkplind=ntpStript->plane;
01201           strkphtot=ntpStript->ph1.sigcor+ntpStript->ph0.sigcor;
01202           if(strkind==ssind && strkplind==ssplind) {
01203             foundtrk=true;
01204             phstript=strkphtot;
01205           }
01206         }
01207 
01208        }
01209       }
01210     }
01211 
01212     if(foundshw && foundtrk) {
01213       hitcommon= hitcommon+1;
01214       phcommon = phcommon+phstrips+phstript;
01215     }
01216     if(!foundshw && ! foundtrk) {
01217       hitnowere=hitnowere+1;
01218       phnowere=phnowere+ssphtot;
01219     }
01220     if(ssplind>=planes && ssplind<=(planes+3)){
01221       ph3=ph3+ssphtot;
01222     }
01223     else if(ssplind>(planes+3) && ssplind<=(planes+6)){
01224       ph6=ph6+ssphtot;
01225     }
01226     else {
01227       phlast=phlast+ssphtot;
01228     }
01229 
01230    } // end of if stp_index != -1
01231 
01232   } // end of looping over event strips....
01233 
01234 //
01235    eventInfo->aPh3_ns       = ph3;
01236    eventInfo->aPh6_ns       = ph6;
01237    eventInfo->aPhlast_ns    = phlast;
01238    eventInfo->aPhcommon_ns  = phcommon;
01239 
01240 
01241   return;
01242 }

void ANtpInfoObjectFillerNC::FillEventInformation ANtpRecoNtpManipulator ntpManipulator,
NtpSREvent ntpEvent,
ANtpEventInfoNC eventInfo
[private]
 

Definition at line 1246 of file ANtpInfoObjectFillerNC.cxx.

References ANtpEventInfo::begPlane, NtpSREvent::bleach, ANtpEventInfo::endPlane, ANtpEventInfoNC::eventDuration, ANtpEventInfoNC::eventSummaryPlanes, ANtpInfoObjectFiller::FillEventInformation(), FindEarlyActivityWeight(), NtpSRBleach::fixedWindowPH, ANtpEventInfoNC::fixedWindowPH, fStripIsXTalkEast, fStripIsXTalkWest, ANtpRecoNtpManipulator::GetSnarlEventSummary(), NtpSRBleach::lateBucketPHFraction, ANtpEventInfoNC::lateBucketPHFraction, ANtpEventInfoNC::lengthInPlanes, ANtpEventInfoNC::maxPHIn12Planes, ANtpEventInfoNC::maxPHIn3Planes, ANtpEventInfoNC::maxPHIn6Planes, ANtpEventInfoNC::maxPHIn9Planes, ANtpEventInfoNC::maxPlanePH, ANtpEventInfoNC::modifiedPH, NtpSRPlane::n, nPlanes, NtpSREvent::nstrip, ANtpEventInfo::passStrips, NtpSRStrip::ph0, NtpSRStrip::ph1, ANtpEventInfoNC::phPerPlane, ANtpEventInfoNC::phPerStrip, NtpSREventSummary::plane, NtpSRStrip::plane, ANtpEventInfo::planes, ANtpEventInfo::pulseHeight, ANtpEventInfoNC::pulseHeightRms, NtpSRPulseHeight::raw, ANtpEventInfoNC::Reset(), NtpSRPulseHeight::sigcor, NtpSREvent::stp, NtpSRBleach::straightPHFraction, ANtpEventInfoNC::straightPHFraction, NtpSRStrip::strip, ANtpEventInfoNC::stripTime1st, ANtpEventInfoNC::stripTimelast, ANtpEventInfoNC::stripTimeMean, ANtpEventInfoNC::stripTimeRMS, NtpSRStrip::time0, NtpSRStrip::time1, NtpSRBleach::timeWeightedPHFraction, ANtpEventInfoNC::timeWeightedPHFraction, ANtpEventInfo::totalStrips, ANtpEventInfoNC::triPlane1PH, ANtpEventInfoNC::triPlane2PH, and ANtpEventInfoNC::triPlaneOverPH.

Referenced by FillInformation().

01249 {
01250 
01251   eventInfo->Reset();
01252   ANtpInfoObjectFiller::FillEventInformation(ntpManipulator,
01253                                              ntpEvent,
01254                                              eventInfo);
01255 
01256   NtpSRStrip *ntpStrip = 0;
01257 
01258   eventInfo->lengthInPlanes = eventInfo->endPlane - eventInfo->begPlane + 1;
01259   eventInfo->lateBucketPHFraction = ntpEvent->bleach.lateBucketPHFraction;
01260   eventInfo->timeWeightedPHFraction = ntpEvent->bleach.timeWeightedPHFraction;
01261   eventInfo->straightPHFraction = ntpEvent->bleach.straightPHFraction;
01262   eventInfo->fixedWindowPH = ntpEvent->bleach.fixedWindowPH;
01263 
01264   //add up the pulse height in each plane to find the maximum in the event
01265   Float_t planePH[500] = {0.};
01266   eventInfo->totalStrips = ntpEvent->nstrip;
01267   eventInfo->passStrips = 0;
01268   eventInfo->modifiedPH = 0.;
01269   if(eventInfo->totalStrips > 0){
01270     eventInfo->phPerStrip = eventInfo->pulseHeight/(1.*eventInfo->totalStrips);
01271     eventInfo->phPerPlane = eventInfo->pulseHeight/(1.*eventInfo->planes);
01272   }
01273 
01274   double maxStripTime = -1.e12;
01275   double minStripTime = 1.e12;
01276 
01277 //......................................................................
01278   // -=NEW VARIABLES=-
01279 
01280   // PLANE ADC (`GLOBAL') VARIABLES
01281   // First make summary of plane ADC
01282   const UInt_t nPlanes(eventInfo->planes);
01283   vector<Float_t> planeAdc(nPlanes+12,0);
01284   // pad vector with 12 zeros. these are needed later
01285   const vector<Float_t>::const_iterator pAdc_begin(planeAdc.begin());
01286   const vector<Float_t>::const_iterator pAdc_last(pAdc_begin + nPlanes);
01287 
01288   // Also calculate some simple event duration type variables
01289   Double_t t_1stStp(10.); //time of first strip in event
01290   Double_t t_lastStp(0.); //  & of last
01291   Double_t t_sumStp(0.);  // sum of times
01292   Double_t t_sum2Stp(0.); // sum of squares of times
01293   Int_t nStpHit( ntpEvent->nstrip ); // number of double ended strips
01294 //......................................................................
01295 
01296   for(Int_t ns = 0; ns < ntpEvent->nstrip; ++ns){
01297 
01298     //get the current strip
01299     if (ntpEvent->stp[ns] >= 0)
01300       ntpStrip = dynamic_cast<NtpSRStrip *>
01301         (fStripArray->At(ntpEvent->stp[ns]));
01302     else continue;
01303     if(ntpStrip->plane>0 && ntpStrip->plane<486){
01304       planePH[ntpStrip->plane] += ntpStrip->ph0.sigcor + ntpStrip->ph1.sigcor;
01305 
01306       if( fDetector == Detector::kFar
01307           && (!fStripIsXTalkWest[ntpStrip->plane][ntpStrip->strip]
01308               || !fStripIsXTalkEast[ntpStrip->plane][ntpStrip->strip]))
01309         ++eventInfo->passStrips;
01310       else if( fDetector == Detector::kNear
01311                && !fStripIsXTalkWest[ntpStrip->plane][ntpStrip->strip])
01312         ++eventInfo->passStrips;
01313 
01314       if(ntpStrip->ph1.raw > 200.) eventInfo->modifiedPH += ntpStrip->ph1.raw;
01315 
01316       if(ntpStrip->time1 > maxStripTime) maxStripTime = ntpStrip->time1;
01317       if(ntpStrip->time1 < minStripTime) minStripTime = ntpStrip->time1;
01318 
01319     }
01320     //......................................................................
01321     // -=NEW VARIABLES=-
01322 
01323     // Plane ADC vars
01324     Int_t pln_index = ntpStrip->plane - eventInfo->begPlane;
01325     if (pln_index < (Int_t) nPlanes && pln_index >= 0) {
01326       planeAdc[pln_index] += ntpStrip->ph0.sigcor;
01327       planeAdc[pln_index] += ntpStrip->ph1.sigcor;
01328     }
01329 
01330     // event duration variables
01331     Double_t t_stpHitA = TMath::Max(ntpStrip->time0 , ntpStrip->time1);
01332     Double_t t_stpHitB = TMath::Min(ntpStrip->time0 , ntpStrip->time1);
01333     //Earlier hit may be -ive, meaning a single ended hit
01334     t_1stStp = TMath::Min(t_1stStp, t_stpHitA);
01335     t_lastStp = TMath::Max(t_lastStp, t_stpHitA);
01336     t_sumStp += t_stpHitA;
01337     t_sum2Stp += t_stpHitA * t_stpHitA;
01338 
01339     if (t_stpHitB > 0 ){
01340       t_1stStp = TMath::Min(t_1stStp, t_stpHitB);
01341       t_lastStp = TMath::Max(t_lastStp, t_stpHitB);
01342       t_sumStp += t_stpHitB;
01343       t_sum2Stp += t_stpHitB * t_stpHitB;
01344       ++nStpHit;
01345     }
01346     //......................................................................
01347 
01348   }//end loop over event strips
01349 
01350   //......................................................................
01351   // -=NEW VARIABLES=-
01352   eventInfo->stripTimeMean = t_sumStp / nStpHit;
01353   Float_t t_variance =  t_sum2Stp / nStpHit
01354     - (t_sumStp / nStpHit) * (t_sumStp / nStpHit);
01355 
01356   eventInfo->stripTimeRMS = TMath::Sqrt(TMath::Abs(t_variance));
01357 
01358   eventInfo->stripTime1st = t_1stStp;
01359   eventInfo->stripTimelast = t_lastStp;
01360   //......................................................................
01361 
01362   eventInfo->eventDuration = maxStripTime - minStripTime;
01363 
01364   if(fDetector == Detector::kNear) FindEarlyActivityWeight(ntpEvent, eventInfo);
01365 
01366   //find the rms of the ph per plane for the event and the
01367   //plane with the max ph.  also find the maximum signal in windows of
01368   //3,6,9,12 planes from the first plane
01369 
01370   TH1F planePHDist("planePHDist", "", 400, 0., 400.);
01371   eventInfo->maxPlanePH = 0.;
01372   eventInfo->maxPHIn3Planes = 0.;
01373   eventInfo->maxPHIn6Planes = 0.;
01374   eventInfo->maxPHIn9Planes = 0.;
01375   eventInfo->maxPHIn12Planes = 0.;
01376 
01377   for(Int_t i = eventInfo->begPlane; i <= eventInfo->endPlane; ++i){
01378     if(planePH[i] > eventInfo->maxPlanePH) eventInfo->maxPlanePH = planePH[i];
01379     if(planePH[i] > 0.) planePHDist.Fill(planePH[i]*1.e-4);
01380   }
01381 
01382   Float_t phInWindow = 0.;
01383   for(Int_t windowSize = 3; windowSize<14; windowSize +=3){
01384     for(Int_t i = eventInfo->begPlane; i<=eventInfo->endPlane; ++i){
01385       phInWindow = 0.;
01386       for(Int_t j = 0; j<windowSize && j+i<=eventInfo->endPlane; ++j){
01387         phInWindow += planePH[i+j];
01388       }
01389       if(windowSize == 3 && eventInfo->maxPHIn3Planes<phInWindow)
01390         eventInfo->maxPHIn3Planes = phInWindow;
01391       else if(windowSize == 6 && eventInfo->maxPHIn6Planes<phInWindow)
01392         eventInfo->maxPHIn6Planes = phInWindow;
01393       else if(windowSize == 9 && eventInfo->maxPHIn9Planes<phInWindow)
01394         eventInfo->maxPHIn9Planes = phInWindow;
01395       else if(windowSize == 12 && eventInfo->maxPHIn12Planes<phInWindow)
01396         eventInfo->maxPHIn12Planes = phInWindow;
01397     } //end loop over planes in event
01398 
01399   }//end loop over window size
01400 
01401   eventInfo->pulseHeightRms = planePHDist.GetRMS();
01402 
01403   //......................................................................
01404   // -=NEW VARIABLES=-
01405 
01406   //Calculate pulse height in plane groups 1 to 3 and 4 to 6
01407   eventInfo->triPlane1PH = accumulate(pAdc_begin, pAdc_begin+3, 0.0 );
01408   eventInfo->triPlane2PH = accumulate(pAdc_begin+3, pAdc_begin+6, 0.0 );
01409   if (nPlanes>6)
01410     eventInfo->triPlaneOverPH = accumulate(pAdc_begin+6, pAdc_last, 0.0 );
01411   else
01412     eventInfo->triPlaneOverPH = 0.0;
01413   //......................................................................
01414 
01415   eventInfo->eventSummaryPlanes = ntpManipulator->GetSnarlEventSummary().plane.n;
01416 
01417   // Image recognition discriminants (KEA)
01418   //FillVHSEvtInfo(ntpManipulator, eventInfo);
01419 
01420   return;
01421 }

void ANtpInfoObjectFillerNC::FillEventTimingAndActivityInformation ANtpRecoNtpManipulator ntpManipulator,
int  event,
ANtpEventInfoNC eventInfo
[private]
 

Definition at line 383 of file ANtpInfoObjectFillerNC.cxx.

References abs(), ANtpEventInfoNC::closeTimeDeltaZ, ANtpEventInfoNC::closeTimeEvent, ANtpEventInfoNC::consecutivePlanes, ANtpEventInfoNC::edgeActivityPH, ANtpEventInfoNC::edgeActivityStrips, ANtpEventInfoNC::evtTimeDiff, ANtpEventManipulator::GetEvent(), ANtpRecoNtpManipulator::GetEventArray(), ANtpRecoNtpManipulator::GetEventManipulator(), GetEvtVtxWithFixup(), ANtpSliceManipulator::GetSlice(), ANtpRecoNtpManipulator::GetSliceManipulator(), GetStripEventTime(), ANtpEventInfo::index, ANtpEventInfoNC::largestEventInSnarl, ANtpEventInfoNC::medianTime, ANtpEventInfoNC::minDeltaZ, ANtpEventInfoNC::minTimeSeparation, NtpSRSlice::nstrip, NtpSREvent::nstrip, ANtpEventInfoNC::oppEdgePH, ANtpEventInfoNC::oppEdgeStrips, NtpSRPulseHeight::pe, NtpSREvent::ph, NtpSRStrip::ph1, NtpSRStrip::plane, ANtpEventManipulator::SetEventInSnarl(), ANtpSliceManipulator::SetSliceInSnarl(), ANtpEventInfoNC::sharedStripFraction, NtpSRPulseHeight::sigcor, NtpSREvent::slc, ANtpEventInfoNC::slicePHFraction, NtpSRSlice::stp, NtpSREvent::stp, NtpSRStrip::strip, NtpSRStrip::time1, and NtpSRStrip::tpos.

Referenced by FillInformation().

00386 {
00387   ANtpEventManipulator* evtManip = ntpManipulator->GetEventManipulator();
00388 
00389   //the event number passed into the method is the current event we care about
00390   evtManip->SetEventInSnarl(event);
00391 
00392   const NtpSREvent* ntpEvent = evtManip->GetEvent();
00393 
00394   // VERTEX TIMING AND DELTA Z CALCULATIONS
00395 
00396   int thisVtxPlane; float thisVtxZ;
00397   GetEvtVtxWithFixup(ntpManipulator, thisVtxPlane, thisVtxZ);
00398 
00399   double thisEvtTime; double thisToFEventTime;
00400   GetStripEventTime(ntpEvent, thisVtxPlane, thisVtxZ,
00401                     thisEvtTime, thisToFEventTime);
00402 
00403   // Smallest difference in event time to another event
00404   Double_t timeDiff = ANtpDefVal::kFloat;
00405   // Index of the event that had the lowest timeDiff
00406   Int_t closeEventIndex = ANtpDefVal::kInt;
00407   // Smallest different in vtx z to another event
00408   Float_t minDeltaZ = ANtpDefVal::kFloat;
00409   // Minimum time-of-flight-corrected time difference
00410   Double_t mintime = ANtpDefVal::kFloat;
00411  
00412   // Loop over all the other events to find the nearest in time and space
00413   for(int i = 0; i <= ntpManipulator->GetEventArray()->GetLast(); ++i){
00414     // don't want to compare time to itself
00415     if(i == event) continue;
00416 
00417     evtManip->SetEventInSnarl(i);
00418     const NtpSREvent* otherEvent = evtManip->GetEvent();
00419 
00420     int otherVtxPlane; float otherVtxZ;
00421     GetEvtVtxWithFixup(ntpManipulator, otherVtxPlane, otherVtxZ);
00422 
00423     double otherEvtTime; double otherToFEventTime;
00424     GetStripEventTime(otherEvent, otherVtxPlane, otherVtxZ,
00425                       otherEvtTime, otherToFEventTime);
00426     // time of flight correction for second event
00427     if( otherToFEventTime !=ANtpDefVal::kDouble) 
00428       otherToFEventTime -= ((otherVtxZ-thisVtxZ)/Munits::c_light);
00429 
00430     const double deltaT = otherEvtTime - thisEvtTime;
00431     if(TMath::Abs(deltaT) < TMath::Abs(timeDiff)){
00432       timeDiff = deltaT;
00433       closeEventIndex = i;
00434       eventInfo->closeTimeDeltaZ = thisVtxZ - otherVtxZ;
00435     }
00436 
00437     // find minimum DeltaZ
00438     const float deltaZ = thisVtxZ - otherVtxZ;
00439     if(TMath::Abs(deltaZ) < TMath::Abs(minDeltaZ)){
00440       minDeltaZ = deltaZ;
00441     }
00442 
00443     if(thisToFEventTime != ANtpDefVal::kDouble  &&  
00444        otherToFEventTime != ANtpDefVal::kDouble)
00445       if(fabs(thisToFEventTime-otherToFEventTime) < fabs(mintime))
00446         mintime = thisToFEventTime-otherToFEventTime;
00447   } // end for i
00448 
00449   eventInfo->minTimeSeparation = timeDiff;
00450   eventInfo->closeTimeEvent = closeEventIndex;
00451   eventInfo->minDeltaZ = minDeltaZ;
00452   eventInfo->medianTime = thisEvtTime;
00453   eventInfo->evtTimeDiff = mintime;
00454   
00455   // ADJACENT STRIP VARIABLES
00456 
00457   // Map from plane number to set of strip numbers in that plane
00458   map<int, set<int> > mplanes;
00459   // Fill map of strips for all other events in this snarl
00460   for(int i = 0; i <= ntpManipulator->GetEventArray()->GetLast(); ++i){
00461     // don't want to compare time to itself
00462     if(i == event) continue;
00463     evtManip->SetEventInSnarl(i);
00464     const NtpSREvent* otherEvent = evtManip->GetEvent();
00465 
00466     // Fill mplanes
00467     for(Int_t ns = 0; ns < otherEvent->nstrip; ++ns){
00468       const int idx = otherEvent->stp[ns];
00469       if(idx < 0) continue;
00470       NtpSRStrip* ntpStrip = (NtpSRStrip*)fStripArray->At(idx);
00471 
00472       if(ntpStrip->ph1.pe >= 2)
00473         mplanes[ntpStrip->plane].insert(ntpStrip->strip);
00474     } // end for ns
00475   } // end for i
00476 
00477   // Number of strips in the event
00478   int nstrips =0;
00479   // Count number of strips with neighbouring strips
00480   int sharedst=0;
00481 
00482   // loop over strips in current event
00483   for(int ns = 0; ns < ntpEvent->nstrip; ++ns){
00484     const int stripIdx = ntpEvent->stp[ns];
00485     if(stripIdx < 0) continue;
00486     NtpSRStrip* ntpStrip = (NtpSRStrip*)fStripArray->At(stripIdx);
00487  
00488     if(ntpStrip->ph1.pe < 2.) continue;
00489     ++nstrips;
00490     map<int, set<int> >::const_iterator PlanesIter =
00491       mplanes.find(ntpStrip->plane);
00492     
00493     //if no hits on same plane, go to next strip
00494       if(PlanesIter == mplanes.end()) continue;
00495       set<int> stps = PlanesIter->second;
00496       const unsigned int stripn = ntpStrip->strip;
00497       
00498       //when I fill histograms i want only min separation per event
00499       for(set<int>::iterator stpit = stps.begin();
00500           stpit != stps.end();
00501           ++stpit){
00502         // Only neighbouring strips
00503         if(abs(int(stripn)-int(*stpit)) <= 1){
00504           ++sharedst;
00505           break;
00506         }
00507       } // end for stpit
00508     } // end for ns
00509 
00510   if(nstrips) 
00511     eventInfo->sharedStripFraction = float(sharedst)/nstrips;
00512   
00513   // SLICE PH FRACTION
00514 
00515   ntpManipulator->GetSliceManipulator()->SetSliceInSnarl(ntpEvent->slc);
00516   NtpSRSlice* ntpSlice = ntpManipulator->GetSliceManipulator()->GetSlice();
00517 
00518   float slicePH= 0;
00519   float eventPH = 0;
00520   for(int it = 0; it < ntpSlice->nstrip; ++it){
00521     const NtpSRStrip* ntpStrip = (NtpSRStrip*)fStripArray->At(ntpSlice->stp[it]);
00522     if(ntpStrip->ph1.pe < 2) continue;
00523     slicePH += ntpStrip->ph1.sigcor;
00524   }
00525 
00526   for(int it = 0; it < ntpEvent->nstrip; ++it){
00527    const NtpSRStrip* ntpStrip = (NtpSRStrip*)fStripArray->At(ntpEvent->stp[it]);
00528    if(ntpStrip->ph1.pe < 2) continue;
00529    eventPH += ntpStrip->ph1.sigcor;
00530   }
00531 
00532   if(slicePH)
00533     eventInfo->slicePHFraction = eventPH/slicePH;
00534 
00535   //NUMBER OF CONSECUTIVE PLANES
00536   Int_t consecutive=1;
00537   vector <int> stripplanes;
00538   for(int it = 0; it < ntpEvent->nstrip; ++it){
00539     const NtpSRStrip* ntpStrip = (NtpSRStrip*)fStripArray->At(ntpEvent->stp[it]);
00540     if(ntpStrip->ph1.pe<2.) continue;
00541     
00542     bool flag=false;
00543     for(unsigned int iv=0;iv<stripplanes.size();iv++)
00544       if(stripplanes[iv]==ntpStrip->plane) flag=true;
00545     if(!flag) stripplanes.push_back(ntpStrip->plane);
00546   }
00547   
00548   for(unsigned int iv=0;iv<stripplanes.size();iv++)
00549     sort(stripplanes.begin(),stripplanes.end());
00550   
00551   for(unsigned int iv=1;iv<stripplanes.size();iv++)
00552     if((-stripplanes[0]+stripplanes[iv]-(consecutive-1))==1)
00553       consecutive++;
00554   
00555   eventInfo->consecutivePlanes=consecutive;
00556   
00557   // EDGE ACTIVITY VARIABLES
00558 
00559   const double activityTimeStart = thisEvtTime - 4e-8; // +/- 40ns window
00560   const double activityTimeStop  = thisEvtTime + 4e-8;
00561 
00562   Int_t edgeActivityStrips=0;
00563   Float_t edgeActivityPH=0;
00564   Int_t oppEdgeStrips=0;
00565   Float_t oppEdgePH=0;
00566 
00567   // loop over strips in snarl
00568   for(int i = 0; i <= fStripArray->GetLast(); ++i){
00569     const NtpSRStrip* strip = (NtpSRStrip*)fStripArray->At(i);
00570 
00571     // consider only strips in time window
00572     if(strip->time1 <= activityTimeStart || strip->time1 >= activityTimeStop)
00573       continue;
00574 
00575     // Only want calorimeter strips
00576     if(strip->plane >= 121) continue;
00577 
00578     if(strip->ph1.pe < 2) continue;
00579 
00580       // look at U planes in calorimeter
00581       if(strip->plane % 2 == 1 && strip->tpos < -0.24){
00582         ++edgeActivityStrips;
00583         edgeActivityPH += strip->ph1.sigcor;
00584       }
00585       // look at opposite edge in U (use 3 strips of fully instr.)
00586       if(strip->plane % 2 == 1 && strip->tpos > 2.27){
00587         ++oppEdgeStrips;
00588         oppEdgePH += strip->ph1.sigcor;
00589       }
00590       // look at V planes in calorimeter
00591       if(strip->plane % 2 == 0 && strip->tpos > 0.24){
00592         ++edgeActivityStrips;
00593         edgeActivityPH += strip->ph1.sigcor;
00594       }
00595       // look at opposite edge in V (use 3 strips of fully instr.)
00596       if(strip->plane % 2 == 0 && strip->tpos <- 2.27){
00597         ++oppEdgeStrips;
00598         oppEdgePH += strip->ph1.sigcor;
00599       }
00600    } // end for i
00601 
00602   eventInfo->edgeActivityPH = edgeActivityPH;
00603   eventInfo->edgeActivityStrips = edgeActivityStrips;
00604   eventInfo->oppEdgePH = oppEdgePH;
00605   eventInfo->oppEdgeStrips = oppEdgeStrips;
00606 
00607   // LARGEST EVENT
00608 
00609   int largestIndex = 0;
00610   double largestPH = 0;
00611   for(int i = 0; i <= ntpManipulator->GetEventArray()->GetLast(); ++i){
00612     evtManip->SetEventInSnarl(i);
00613     const NtpSREvent* otherEvent = evtManip->GetEvent();
00614     if(otherEvent->ph.sigcor > largestPH){
00615       largestPH = otherEvent->ph.sigcor;
00616       largestIndex = i;
00617     }
00618   }
00619 
00620   if(eventInfo->index == largestIndex)
00621     eventInfo->largestEventInSnarl = 1;
00622 
00623   //make sure to set the event manipulator back to the correct event
00624   ntpManipulator->GetEventManipulator()->SetEventInSnarl(event);
00625 }

bool ANtpInfoObjectFillerNC::FillInformation int  event,
ANtpRecoNtpManipulator ntpManipulator,
ANtpEventInfoNC eventInfo,
ANtpTrackInfoNC trackInfo,
ANtpShowerInfoNC showerInfo,
ANtpTruthInfoBeam truthInfo
 

Definition at line 245 of file ANtpInfoObjectFillerNC.cxx.

References NtpTHEvent::completeall, ANtpTruthInfoBeam::eventCompleteness, FillCrossOverInformation(), FillEventInformation(), FillEventTimingAndActivityInformation(), FillMCInformation(), FillShowerInformation(), FillTrackInformation(), ANtpEventManipulator::GetEvent(), ANtpRecoNtpManipulator::GetEventManipulator(), ANtpRecoNtpManipulator::GetMCManipulator(), ANtpMCManipulator::GetNtpMCTruth(), ANtpMCManipulator::GetNtpTHEvent(), ANtpEventManipulator::GetPrimaryShower(), ANtpEventManipulator::GetPrimaryTrack(), ANtpRecoNtpManipulator::GetStdHepArray(), MAXMSG, NtpTHEvent::neumc, and ANtpEventManipulator::SetEventInSnarl().

Referenced by CondensedNtpModuleNC::Ana(), and NuExtraction::ExtractNCInfo().

00251 {
00252 
00253   NtpSRTrack  *ntpTrack = 0;
00254   NtpSREvent  *ntpEvent = 0;
00255   NtpSRShower *ntpShower = 0;
00256   NtpMCTruth  *ntpMCTruth = 0;
00257   NtpTHEvent  *ntpTHEvent = 0;
00258 
00259   MAXMSG("ANtpInfoObjectFillerNC", Msg::kDebug,20)
00260     << "Begin Fill Information method..." << endl;
00261 
00262   //get event.  the call to ANtpEventManipulator::SetEventInSnarl sets the
00263   //NtpSREvent data member in that object to the current event so that
00264   //you can later call for the primary track, shower, etc.
00265   ntpManipulator->GetEventManipulator()->SetEventInSnarl(event);
00266   ntpEvent = ntpManipulator->GetEventManipulator()->GetEvent();
00267   if(!ntpEvent) return false;
00268 
00269   FillEventInformation(ntpManipulator, ntpEvent, eventInfo);
00270   FillEventTimingAndActivityInformation(ntpManipulator, event, eventInfo);
00271 
00272   //get the primary shower for the event - if no shower is present it
00273   //returns 0
00274   ntpShower = ntpManipulator->GetEventManipulator()->GetPrimaryShower();
00275   if(ntpShower) FillShowerInformation(ntpShower, showerInfo, eventInfo);
00276 
00277   //get the primary track for the event - if no track is present it
00278   //returns 0
00279   ntpTrack = ntpManipulator->GetEventManipulator()->GetPrimaryTrack();
00280   if(ntpTrack)
00281     FillTrackInformation(ntpManipulator, ntpTrack, ntpEvent, trackInfo, eventInfo);
00282 
00283   FillCrossOverInformation(ntpTrack, ntpShower, ntpEvent, ntpManipulator,
00284                            trackInfo, showerInfo, eventInfo);
00285 
00286   // Get the truth information for this track if it is MC
00287   // Get best neu match from Truthhelper
00288   ntpTHEvent = ntpManipulator->GetMCManipulator()->GetNtpTHEvent(event);
00289 
00290   if(ntpTHEvent)
00291     ntpMCTruth = ntpManipulator->GetMCManipulator()->GetNtpMCTruth(ntpTHEvent->neumc);
00292   if(ntpMCTruth)
00293     FillMCInformation(ntpMCTruth, ntpManipulator->GetStdHepArray(), truthInfo);
00294   // added by Tobi
00295   if (truthInfo && ntpTHEvent)
00296     truthInfo->eventCompleteness = ntpTHEvent->completeall;
00297 
00298   return true;
00299 }

void ANtpInfoObjectFillerNC::FillMCInformation NtpMCTruth ntpMCTruth,
TClonesArray *  stdHepArray,
ANtpTruthInfoBeam truthInfo
[private]
 

Definition at line 1425 of file ANtpInfoObjectFillerNC.cxx.

References ANtpInfoObjectFillerBeam::FillBeamMCTruthInformation(), ANtpInfoObjectFiller::FillMCTruthInformation(), and ANtpTruthInfoBeam::Reset().

Referenced by FillInformation().

01428 {
01429   truthInfo->Reset();
01430   ANtpInfoObjectFiller::FillMCTruthInformation(ntpMCTruth, truthInfo);
01431   ANtpInfoObjectFillerBeam::FillBeamMCTruthInformation(ntpMCTruth, stdHepArray, truthInfo);
01432 
01433   return;
01434 }

void ANtpInfoObjectFillerNC::FillPlanePixelSignalArrays NtpSREvent ntpEvent  )  [private]
 

Definition at line 1437 of file ANtpInfoObjectFillerNC.cxx.

References fPlaneCoverage, fPlanePixelEastSignal, fPlanePixelWestSignal, fPlaneToPMTMapEast, fPlaneToPMTMapWest, fStripToPixelMapEast, fStripToPixelMapNearU1, fStripToPixelMapNearU2, fStripToPixelMapNearU3, fStripToPixelMapNearV1, fStripToPixelMapNearV2, fStripToPixelMapNearV3, fStripToPixelMapWest, MSG, NtpSREvent::nstrip, NtpSRStrip::ph0, NtpSRStrip::ph1, NtpSRStrip::plane, NtpSRStrip::planeview, NtpSRStrip::pmtindex0, NtpSRStrip::pmtindex1, NtpSRPulseHeight::sigcor, NtpSREvent::stp, and NtpSRStrip::strip.

01438 {
01439   MSG("ANtpInfoObjectFillerNC", Msg::kDebug) << "in FillPlanePixelSignalArrays" << endl;
01440 
01441   NtpSRStrip *ntpStrip = 0;
01442 
01443   Int_t pixel = 0;
01444   Int_t plane = 0;
01445 
01446   //fill the plane to pmt map first.  the idea is that there are at most 2 PMT's per plane
01447   //in either detector.  put one NtpSRStrip->pmtindex0(1) into the fPlaneToPMTMapEast(West)
01448   //array.  near detector only has pmt's on the west side.  call that pmt 0 for the plane.
01449   //then when filling the signal arrays if the pmtindex0(1) for a strip is not the one in the
01450   //array, it is pmt 1 for the plane.
01451   for(Int_t ns = 0; ns < ntpEvent->nstrip; ++ns){
01452 
01453     //get the NtpSRStrip object
01454     if (ntpEvent->stp[ns] >= 0)
01455       ntpStrip = dynamic_cast<NtpSRStrip *>
01456         (fStripArray->At(ntpEvent->stp[ns]));
01457     else continue;
01458     plane = ntpStrip->plane;
01459 
01460     MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01461       << "plane " << plane << " strip " << ntpStrip->strip
01462       << " pmt1 " << ntpStrip->pmtindex1 << endl;
01463     MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01464       << " pmt0 " << ntpStrip->pmtindex0 << endl;
01465 
01466     fPlaneToPMTMapWest[plane] = ntpStrip->pmtindex1;
01467     if(fDetector == Detector::kFar) fPlaneToPMTMapEast[plane] = ntpStrip->pmtindex0;
01468 
01469   }//end loop over strips to fill plane to pmt maps
01470 
01471   MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01472     << "finish filling plane to pmt maps" << endl;
01473 
01474   //loop over all the strips and put the signal size in the arrays
01475   for(Int_t ns = 0; ns < ntpEvent->nstrip; ++ns){
01476 
01477     //get the NtpSRStrip object
01478     if(ntpEvent->stp[ns] >= 0)
01479       ntpStrip = dynamic_cast<NtpSRStrip *>
01480         (fStripArray->At(ntpEvent->stp[ns]));
01481     else continue;
01482     plane = ntpStrip->plane;
01483 
01484     MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01485       << "plane " << plane << " strip " << ntpStrip->strip
01486       << " detector " << fDetector << endl;
01487 
01488     //got the strip, now fill the plane pixel info
01489     if(fDetector == Detector::kFar){
01490 
01491       //east first
01492       pixel = fStripToPixelMapEast[ntpStrip->strip];
01493 
01494       if(ntpStrip->pmtindex0 == fPlaneToPMTMapEast[plane])
01495         fPlanePixelEastSignal[plane][pixel][0] = ntpStrip->ph0.sigcor;
01496       else
01497         fPlanePixelEastSignal[plane][pixel][1] = ntpStrip->ph0.sigcor;
01498 
01499       //now west
01500       pixel = fStripToPixelMapWest[ntpStrip->strip];
01501       if(ntpStrip->pmtindex1 == fPlaneToPMTMapWest[plane])
01502         fPlanePixelWestSignal[plane][pixel][0] = ntpStrip->ph1.sigcor;
01503       else
01504         fPlanePixelWestSignal[plane][pixel][1] = ntpStrip->ph1.sigcor;
01505 
01506     }//end if far detector;
01507     else if(fDetector == Detector::kNear){
01508 
01509       //figure out what type of plane you are
01510       //planeview = 2 --> U, 3 --> V
01511       //map types 2 and 3 are for full planes, 1 is for partial
01512       MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01513         << "in near detector algorithm "
01514         << " plane " << plane
01515         << " coverage = " << fPlaneCoverage[plane]
01516         << " view = " << (int)ntpStrip->planeview << endl;
01517 
01518       if(fPlaneCoverage[plane] == kNearFull){
01519 
01520         if((int)ntpStrip->planeview == kU){
01521           pixel = fStripToPixelMapNearU2[ntpStrip->strip];
01522           if(pixel < 0) pixel = fStripToPixelMapNearU3[ntpStrip->strip];
01523           if(pixel < 0)
01524             MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01525               << "cannot find pixel for strip " << ntpStrip->strip
01526               << " plane " << plane << endl;
01527 
01528         }
01529         else if((int)ntpStrip->planeview == kV){
01530           pixel = fStripToPixelMapNearV2[ntpStrip->strip];
01531           if(pixel < 0) pixel = fStripToPixelMapNearV3[ntpStrip->strip];
01532           if(pixel < 0)
01533             MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01534               << "cannot find pixel for strip " << ntpStrip->strip
01535               << " plane " << plane << endl;
01536 
01537         }
01538 
01539       }//end if full
01540       else if(fPlaneCoverage[plane] == kNearPartial){
01541 
01542         if((int)ntpStrip->planeview == kU)
01543           pixel = fStripToPixelMapNearU1[ntpStrip->strip];
01544         else if((int)ntpStrip->planeview == kV)
01545           pixel = fStripToPixelMapNearV1[ntpStrip->strip];
01546 
01547       }//end if partial
01548 
01549       if(ntpStrip->pmtindex1 == fPlaneToPMTMapWest[plane])
01550         fPlanePixelWestSignal[plane][pixel][0] = ntpStrip->ph1.sigcor;
01551       else
01552         fPlanePixelWestSignal[plane][pixel][1] = ntpStrip->ph1.sigcor;
01553 
01554 
01555     }//end if near detector
01556   }//end loop over strips
01557 
01558   return;
01559 }

void ANtpInfoObjectFillerNC::FillShowerInformation NtpSRShower ntpShower,
ANtpShowerInfoNC showerInfo,
ANtpEventInfoNC eventInfo
[private]
 

Definition at line 910 of file ANtpInfoObjectFillerNC.cxx.

References ANtpShowerInfoNC::aShwdig_ns, ANtpShowerInfoNC::aShwplu_ns, ANtpShowerInfoNC::aShwplv_ns, NtpSRShower::clu, ANtpShowerInfoNC::emFrac, ANtpShowerInfoNC::energyGeV, fClusterArray, ANtpInfoObjectFiller::FillShowerInformation(), fStripIsXTalkEast, fStripIsXTalkWest, NtpSRStripPulseHeight::gev, NtpSRCluster::id, MSG, NtpSRShower::ncluster, NtpSRStrip::ndigit, NtpSRShower::ndigit, NtpSRCluster::nstrip, NtpSRShower::nstrip, NtpSRPlane::nu, NtpSRPlane::nv, NtpSRShower::ph, NtpSRStrip::ph0, NtpSRStrip::ph1, ANtpShowerInfoNC::phKurtosis, ANtpShowerInfoNC::phPerPlane, ANtpShowerInfoNC::phPerStrip, NtpSRStrip::plane, NtpSRShower::plane, ANtpEventInfo::planes, ANtpShowerInfo::planes, ANtpShowerInfoNC::planeUseFraction, NtpSRStrip::planeview, ANtpEventInfo::pulseHeight, ANtpShowerInfo::pulseHeight, ANtpShowerInfoNC::Reset(), NtpSRPulseHeight::sigcor, ANtpShowerInfoNC::signalUseFraction, NtpSRShower::stp, NtpSRStrip::strip, ANtpShowerInfo::totalStrips, NtpSRStrip::tpos, ANtpShowerInfoNC::transverseRMSU, ANtpShowerInfoNC::transverseRMSV, ANtpShowerInfoNC::twoEndStripFraction, and ANtpShowerInfoNC::xTalkStrips.

Referenced by FillInformation().

00913 {
00914 
00915   showerInfo->Reset();
00916   ANtpInfoObjectFiller::FillShowerInformation(ntpShower, showerInfo);
00917 
00918   if(showerInfo->totalStrips > 0){
00919     showerInfo->phPerStrip = showerInfo->pulseHeight/(1.*showerInfo->totalStrips);
00920     showerInfo->phPerPlane = showerInfo->pulseHeight/(1.*showerInfo->planes);
00921   }
00922 
00923   NtpSRStrip *ntpStrip = 0;
00924 
00925   showerInfo->energyGeV = ntpShower->ph.gev;
00926 
00927   Int_t index = 0;
00928   Int_t numDigits = 0;
00929   Int_t numDoubleEndedStrips = 0;
00930 
00931   showerInfo->planeUseFraction = -1.;
00932   showerInfo->signalUseFraction = -1.;
00933   if(eventInfo->pulseHeight>0.)
00934     showerInfo->signalUseFraction = showerInfo->pulseHeight/(eventInfo->pulseHeight);
00935   if(eventInfo->planes>0)
00936     showerInfo->planeUseFraction = 1.*showerInfo->planes/(1.*eventInfo->planes);
00937 
00938   Int_t plane = 0;
00939   Int_t strip = 0;
00940 
00941   showerInfo->xTalkStrips = 0;
00942   showerInfo->twoEndStripFraction = -1.;
00943 
00944   Float_t sumTposU = 0.;
00945   Float_t sum2TposU = 0.;
00946   Float_t sumPHU = 0.;
00947   Float_t maxTposU = -10.;
00948   Float_t minTposU = 10.;
00949 
00950   Float_t sumTposV = 0.;
00951   Float_t sum2TposV = 0.;
00952   Float_t sumPHV = 0.;
00953   Float_t maxTposV = -10.;
00954   Float_t minTposV = 10.;
00955 
00956   Float_t sumPHsigcor(0.);
00957   Int_t nstrip = ntpShower->nstrip;
00958 
00959   MSG("ANtpInfoObjectFillerNC", Msg::kDebug) << "shower strips = "
00960                                              << ntpShower->nstrip << endl;
00961 
00962    showerInfo->aShwdig_ns          = ntpShower->ndigit;
00963    showerInfo->aShwplu_ns          = ntpShower->plane.nu;
00964    showerInfo->aShwplv_ns          = ntpShower->plane.nv;
00965 //    showerInfo->aShwph_ns        = ntpShower->ph.sigcor;
00966 //    showerInfo->aShwphper_ns        = ntpShower->ph.sigcor/ntpEvent ->ph.sigcor;
00967 //    showerInfo->aShwphperpl_ns      = ntpShower->ph.sigcor/ntpShower->plane.n;
00968 //    showerInfo->aShwphperdig_ns     = ntpShower->ph.sigcor/ntpShower->ndigit;
00969 //    showerInfo->aShwphperstp_ns     = ntpShower->ph.sigcor/ntpShower->nstrip;
00970 
00971 
00972   for(Int_t ns = 0; ns < ntpShower->nstrip; ++ns){
00973 
00974     //get the index for this strip
00975     index = ntpShower->stp[ns];
00976 
00977     //get the NtpSRStrip object
00978     ntpStrip = dynamic_cast<NtpSRStrip *>(fStripArray->At(index));
00979     plane = (int)ntpStrip->plane;
00980     strip = ntpStrip->strip;
00981 
00982     //......................................................................
00983     // -=NEW VARIABLES=-
00984     // use all strips for now
00985     sumPHsigcor += (ntpStrip->ph0.sigcor + ntpStrip->ph1.sigcor);
00986     //......................................................................
00987 
00988     numDigits = (int)ntpStrip->ndigit;
00989     if(numDigits == 2) ++numDoubleEndedStrips;
00990 
00991     if(fDetector == Detector::kNear){
00992       if(fStripIsXTalkWest[plane][strip]) ++showerInfo->xTalkStrips;
00993     }
00994     else if(fDetector == Detector::kFar){
00995       if(fStripIsXTalkEast[plane][strip] && fStripIsXTalkWest[plane][strip])
00996         ++showerInfo->xTalkStrips;
00997     }//end if far detector
00998 
00999     if(ntpStrip->ndigit == 1) continue;
01000     Float_t stpPH(ntpStrip->ph0.sigcor + ntpStrip->ph1.sigcor);
01001     if (ntpStrip->planeview == PlaneView::kU){
01002       maxTposU = TMath::Max(maxTposU, ntpStrip->tpos);
01003       minTposU = TMath::Min(minTposU, ntpStrip->tpos);
01004       sumTposU += (ntpStrip->tpos)*stpPH;
01005       sum2TposU += (ntpStrip->tpos * ntpStrip->tpos) * stpPH;
01006       sumPHU += stpPH;
01007     }
01008     else if (ntpStrip->planeview == PlaneView::kV){
01009       maxTposV = TMath::Max(maxTposV, ntpStrip->tpos);
01010       minTposV = TMath::Min(minTposV, ntpStrip->tpos);
01011       sumTposV += ntpStrip->tpos * stpPH;
01012       sum2TposV += (ntpStrip->tpos * ntpStrip->tpos) * stpPH;
01013       sumPHV +=stpPH;
01014     }
01015 
01016   }//end loop over strips
01017 
01018   MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01019     << "total strips = " << showerInfo->totalStrips << endl;
01020 
01021   if(showerInfo->totalStrips>0)
01022     showerInfo->twoEndStripFraction = (1.*numDoubleEndedStrips)/(1.*showerInfo->totalStrips);
01023 
01024   if(sumPHU>0){
01025     Float_t centroidU = sumTposU;
01026     if(sumPHU > 0.) centroidU /= sumPHU;
01027     else centroidU = 0.;
01028     showerInfo->transverseRMSU = TMath::Sqrt(TMath::Abs(sum2TposU/sumPHU - centroidU*centroidU));
01029   }
01030   else showerInfo->transverseRMSU = 0.;
01031 
01032   if(sumPHV>0){
01033     Float_t centroidV = sumTposV;
01034     if(sumPHV > 0.) centroidV /= sumPHV;
01035     else centroidV = 0.;
01036     showerInfo->transverseRMSV = TMath::Sqrt(TMath::Abs(sum2TposV/sumPHV - centroidV*centroidV));
01037   }
01038   else showerInfo->transverseRMSV = 0.;
01039 
01040   //......................................................................
01041   // -=NEW VARIABLES=-
01042   // fills the variables emFrac and phKurtosis
01043 
01044     Float_t meanPHsigcor = sumPHsigcor/nstrip;
01045     Float_t secondMoment(0.);
01046     Float_t fourthMoment(0.);
01047 
01048     for (Int_t stp_index_shw = 0; stp_index_shw < nstrip ; ++stp_index_shw){
01049       Int_t stp_index = ntpShower->stp[stp_index_shw];
01050       NtpSRStrip* strip =
01051         dynamic_cast<NtpSRStrip *>(fStripArray->At(stp_index));
01052       Float_t stpPH(strip->ph0.sigcor + strip->ph1.sigcor);
01053       secondMoment += TMath::Power((stpPH - meanPHsigcor),2);
01054       fourthMoment += TMath::Power((stpPH - meanPHsigcor),4);
01055     }
01056     Float_t sigma = secondMoment/(nstrip-1);
01057 
01058     // Kurtosis of ph distribution as defined in Numerical Recipes
01059     showerInfo->phKurtosis = fourthMoment/(nstrip*sigma*sigma)-3.0;
01060 
01061     Int_t emLikeStrips(0);
01062     Bool_t cluFailure(false); // check for very rare cluster failure
01063     for (Int_t clu_index_shw = 0; clu_index_shw < ntpShower->ncluster ;
01064          ++clu_index_shw){
01065       Int_t clu_index = ntpShower->clu[clu_index_shw];
01066 
01067       if (clu_index<0) {
01068         MSG("ANtpInfoObjectFillerNC",Msg::kError)
01069           << "Array index for cluster less than 0. This should never happen!"
01070           << endl;
01071         cluFailure = true;
01072         continue;
01073       }
01074 
01075       NtpSRCluster* cluster =
01076         dynamic_cast<NtpSRCluster *>(fClusterArray->At(clu_index));
01077       if (cluster->id == 0)
01078         emLikeStrips += cluster->nstrip;
01079     }
01080     if (!cluFailure)
01081       showerInfo->emFrac = (1.0* emLikeStrips)/ntpShower->nstrip;
01082     else
01083       showerInfo->emFrac = -1;
01084 
01085     //......................................................................
01086 
01087   return;
01088 }

void ANtpInfoObjectFillerNC::FillStripToPixelMaps  )  [private]
 

Definition at line 107 of file ANtpInfoObjectFillerNC.cxx.

References fPlaneCoverage, fStripToPixelMapEast, fStripToPixelMapNearU1, fStripToPixelMapNearU2, fStripToPixelMapNearU3, fStripToPixelMapNearV1, fStripToPixelMapNearV2, fStripToPixelMapNearV3, fStripToPixelMapWest, and MSG.

Referenced by ANtpInfoObjectFillerNC(), and SetDetector().

00108 {
00109   // Fills the strip to pixel map. Call this when you pick a detector
00110 
00111   if(fDetector  == Detector::kFar){
00112 
00113     //Define the FD strip to pixel maps
00114     Int_t stripToPixelWest[] = {0, 2, 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6,
00115                                 0, 2, 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6,
00116                                 0, 2, 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6,
00117                                 0, 2, 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6,
00118                                 0, 2, 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6,
00119                                 0, 2, 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6,
00120                                 0, 2, 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6,
00121                                 0, 2, 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6};
00122 
00123     Int_t stripToPixelEast[] = {0, 2, 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6,
00124                                 2, 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6, 0,
00125                                 5, 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6, 0, 2,
00126                                 7, 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6, 0, 2, 5,
00127                                 8, 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6, 0, 2, 5, 7,
00128                                 10, 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6, 0, 2, 5, 7, 8,
00129                                 13, 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6, 0, 2, 5, 7, 8, 10,
00130                                 15, 0, 2, 5, 7, 1, 3, 4, 6, 9, 11, 12, 14, 1, 3, 4, 6, 0, 2, 5, 7, 8, 10, 13};
00131 
00132     // Fill the strip to pixe map data members
00133     for(Int_t i = 0; i < 192; ++i){
00134       fStripToPixelMapWest[i] = stripToPixelWest[i];
00135       fStripToPixelMapEast[i] = stripToPixelEast[i];
00136     }
00137 
00138     // set plane coverages
00139     for(Int_t i = 0; i < 486; ++i) fPlaneCoverage[i] = kComplete;
00140   } // end filling strip to pixel map for far detector
00141 
00142   else if(fDetector == Detector::kNear){
00143 
00144     // Define the pixel to strip maps
00145     Int_t pixelToStripU1[] = {40, 53, 22, 35, 11, 41, 54, 23,
00146                               36, 10, 42, 55, 24, 37,  9, 43,
00147                               56, 25, 38,  8, 44, 57, 26, 39,
00148                               7, 45, 58, 27, 19,  6, 46, 59,
00149                               28, 18,  5, 47, 60, 29, 17,  4,
00150                               48, 61, 30, 16,  3, 49, 62, 31,
00151                               15,  2, 50, 63, 32, 14,  1, 51,
00152                               20, 33, 13,  0, 52, 21, 34, 12};
00153 
00154     Int_t pixelToStripV1[] = {27, 14, 45, 32, 56, 26, 13, 44,
00155                               31, 57, 25, 12, 43, 30, 58, 24,
00156                               11, 42, 29, 59, 23, 10, 41, 28,
00157                               60, 22,  9, 40, 48, 61, 21,  8,
00158                               39, 49, 62, 20,  7, 38, 50, 63,
00159                               19,  6, 37, 51, 64, 18,  5, 36,
00160                               52, 65, 17,  4, 35, 53, 66, 16,
00161                               47, 34, 54, 67, 15, 46, 33, 55};
00162 
00163     Int_t pixelToStripU2[] = {68, 81, 94, 59, -1, 69, 82, 95,
00164                               60, -1, 70, 83, 48, 61, -1, 71,
00165                               84, 49, 62, -1, 72, 85, 50, 63,
00166                               -1, 73, 86, 51, 64, -1, 74, 87,
00167                               52, 65, -1, 75, 88, 53, 66, -1,
00168                               76, 89, 54, 67, -1, 77, 90, 55,
00169                               -1, -1, 78, 91, 56, -1, -1, 79,
00170                               92, 57, -1, -1, 80, 93, 58, -1};
00171 
00172     Int_t pixelToStripV2[] = {27, 14,  1, 36, -1, 26, 13,  0,
00173                               35, -1, 25, 12, 47, 34, -1, 24,
00174                               11, 46, 33, -1, 23, 10, 45, 32,
00175                               -1, 22,  9, 44, 31, -1, 21,  8,
00176                               43, 30, -1, 20,  7, 42, 29, -1,
00177                               19,  6, 41, 28, -1, 18,  5, 40,
00178                               -1, -1, 17,  4, 39, -1, -1, 16,
00179                               3, 38, -1, -1, 15,  2, 37, -1};
00180 
00181     Int_t pixelToStripU3[] = {47, 34, 21,  8, -1, 46, 33, 20,
00182                               7, -1, 45, 32, 19,  6, -1, 44,
00183                               31, 18,  5, -1, 43, 30, 17,  4,
00184                               -1, 42, 29, 16,  3, -1, 41, 28,
00185                               15,  2, -1, 40, 27, 14,  1, -1,
00186                               39, 26, 13,  0, -1, 38, 25, 12,
00187                               -1, -1, 37, 24, 11, -1, -1, 36,
00188                               23, 10, -1, -1, 35, 22,  9, -1};
00189 
00190     Int_t pixelToStripV3[] = {48, 61, 74, 87, -1, 49, 62, 75,
00191                               88, -1, 50, 63, 76, 89, -1, 51,
00192                               64, 77, 90, -1, 52, 65, 78, 91,
00193                               -1, 53, 66, 79, 92, -1, 54, 67,
00194                               80, 93, -1, 55, 68, 81, 94, -1,
00195                               56, 69, 82, 95, -1, 57, 70, 83,
00196                               -1, -1, 58, 71, 84, -1, -1, 59,
00197                               72, 85, -1, -1, 60, 73, 86, -1};
00198 
00199     //now fill the strip to pixel map data members
00200     for(Int_t i = 0; i < 64; ++i){
00201       fStripToPixelMapNearU1[pixelToStripU1[i]] = i;
00202       fStripToPixelMapNearV1[pixelToStripV1[i]] = i;
00203 
00204       fStripToPixelMapNearU2[i] = -1;
00205       if(pixelToStripU2[i]>-1) fStripToPixelMapNearU2[pixelToStripU2[i]] = i;
00206 
00207       fStripToPixelMapNearV2[i] = -1;
00208       if(pixelToStripV2[i]>-1) fStripToPixelMapNearV2[pixelToStripV2[i]] = i;
00209 
00210       fStripToPixelMapNearU3[i] = -1;
00211       if(pixelToStripU3[i]>-1) fStripToPixelMapNearU3[pixelToStripU3[i]] = i;
00212 
00213       fStripToPixelMapNearV3[i] = -1;
00214       if(pixelToStripV3[i]>-1) fStripToPixelMapNearV3[pixelToStripV3[i]] = i;
00215 
00216     }//end fill strip to pixel maps
00217 
00218     //fill the array of plane coverages
00219     for(Int_t i = 0; i < 282; ++i){
00220       if( i%5 == 1 ) fPlaneCoverage[i] = kNearFull;
00221       else fPlaneCoverage[i] = kNearPartial;
00222     }
00223   }//end filling strip to pixel map for near detector
00224 
00225   MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
00226     << "ANtpInfoObjectFillerNC::Constructor" << endl;
00227 
00228 }

void ANtpInfoObjectFillerNC::FillTrackInformation ANtpRecoNtpManipulator ntpManipulator,
NtpSRTrack ntpTrack,
NtpSREvent ntpEvent,
ANtpTrackInfoNC trackInfo,
ANtpEventInfoNC eventInfo
[private]
 

Definition at line 687 of file ANtpInfoObjectFillerNC.cxx.

References ANtpTrackInfoNC::aTrklen_ns, ANtpTrackInfoNC::aTrkpass_ns, ANtpTrackInfoNC::aTrkph_ns, ANtpTrackInfoNC::aTrkphper_ns, ANtpTrackInfoNC::aTrkphperpl_ns, ANtpTrackInfoNC::aTrkplu_ns, ANtpTrackInfoNC::aTrkplv_ns, ANtpTrackInfoNC::aTrkstp_ns, ANtpTrackInfoNC::aTrkvtx_ns, ANtpTrackInfoNC::dtdz, fAnpInterface, ANtpInfoObjectFiller::FillTrackInformation(), NtpSRTrack::fit, fStripIsXTalkEast, fStripIsXTalkWest, ANtpRecoNtpManipulator::GetEventManipulator(), ANtpEventManipulator::GetPrimaryTrackNS(), Anp::Interface::GetVar(), ANtpTrackInfoNC::kNN, ANtpTrackInfo::length, ANtpTrackInfoNC::meanLowStripDivHighStrip, ANtpTrackInfoNC::meanSigCor, MSG, NtpSRStrip::ndigit, NtpSREvent::nstrip, NtpSRTrack::nstrip, NtpSRTrackPlane::ntrklike, NtpSRPlane::nu, ANtpTrackInfoNC::numScintPlanes, NtpSRPlane::nv, NtpSRFitTrack::pass, NtpSRPulseHeight::pe, NtpSREvent::ph, NtpSRTrack::ph, NtpSRStrip::ph0, NtpSRStrip::ph1, ANtpTrackInfoNC::phPerPlane, ANtpTrackInfoNC::phPerStrip, NtpSRStrip::plane, NtpSRTrack::plane, ANtpEventInfo::planes, ANtpTrackInfo::planes, ANtpTrackInfoNC::planeUseFraction, NtpSRStrip::planeview, ANtpEventInfo::pulseHeight, ANtpTrackInfo::pulseHeight, ANtpTrackInfoNC::Reset(), NtpSRPulseHeight::sigcor, ANtpTrackInfoNC::signalUseFraction, NtpSRTrack::stp, NtpSREvent::stp, NtpSRTrack::stpx, NtpSRTrack::stpy, NtpSRTrack::stpz, NtpSRStrip::strip, NtpSRStrip::time0, NtpSRStrip::time1, ANtpTrackInfo::totalStrips, ANtpTrackInfoNC::trackLikePlanes, ANtpTrackInfoNC::trackSigCorFraction, ANtpTrackInfoNC::twoEndStripFraction, ANtpTrackInfoNC::uvAsymmetry, NtpSRTrack::vtx, ANtpTrackInfoNC::xTalkStrips, NtpSRStrip::z, and NtpSRVertex::z.

Referenced by FillInformation().

00692 {
00693 
00694   trackInfo->Reset();
00695   ANtpInfoObjectFiller::FillTrackInformation(ntpTrack, trackInfo);
00696 
00697   if(trackInfo->totalStrips > 0){
00698     trackInfo->phPerStrip = trackInfo->pulseHeight/(1.*trackInfo->totalStrips);
00699     trackInfo->phPerPlane = trackInfo->pulseHeight/(1.*trackInfo->planes);
00700   }
00701 
00702   NtpSRStrip *ntpStrip = 0;
00703 
00704   Int_t plane = 0, strip = 0, stpCtr = 0;
00705   Float_t xPos = 0., yPos = 0., zPos = 0.;
00706   Int_t uXTalkStripCtr = 0;
00707   Int_t vXTalkStripCtr = 0;
00708 
00709   Int_t numDigits = 0, numDoubleEndedStrips = 0;
00710   Int_t stripsInPlane[500], trkStripsInPlane[500];
00711 
00712   //....................................................................
00713   // Estimate dtdz of track, using linear regression of (y = Gx +H)
00714   // <G> = (<xy> - <x><y>) / (<x^2> - <x>^2)
00715   Double_t sumZT(0.); Double_t sumZ2(0.);
00716   Double_t sumT(0.); Double_t sumZ(0.);
00717   Int_t nHits(0); // # of digits at FD, # of strips at ND. whew!
00718 
00719   //....................................................................
00720 
00721     ntpTrack = ntpManipulator->GetEventManipulator()->GetPrimaryTrackNS();
00722 
00723     trackInfo->aTrkpass_ns         =ntpTrack->fit.pass;
00724     trackInfo->aTrkph_ns           =ntpTrack->ph.sigcor;
00725     trackInfo->aTrklen_ns          =ntpTrack->plane.ntrklike;
00726     if(ntpTrack->plane.ntrklike>0) trackInfo->aTrkphperpl_ns   = ntpTrack->ph.sigcor/ntpTrack->plane.ntrklike;
00727     if(ntpEvent->ph.sigcor>0)      trackInfo->aTrkphper_ns     = ntpTrack->ph.sigcor/ntpEvent->ph.sigcor;
00728     trackInfo->aTrkplu_ns          =ntpTrack->plane.nu;
00729     trackInfo->aTrkplv_ns          =ntpTrack->plane.nv;
00730     trackInfo->aTrkstp_ns          =ntpTrack->nstrip;
00731     trackInfo->aTrkvtx_ns          =ntpTrack->vtx.z;
00732 
00733   for(Int_t ii = 0; ii < 500; ++ii){
00734     stripsInPlane[ii] = 0;
00735     trkStripsInPlane[ii] = 0;
00736   }
00737 
00738   //loop over the strips in the record and keep track of how many
00739   //are in each plane
00740   Float_t totalPH = 0.;
00741 
00742   for(Int_t i = 0; i < ntpEvent->nstrip; ++i){
00743 
00744     if(ntpEvent->stp[i] >= 0)
00745       ntpStrip = dynamic_cast<NtpSRStrip *>
00746         (fStripArray->At(ntpEvent->stp[i]));
00747     else continue;
00748     plane = (int)ntpStrip->plane;
00749     strip = ntpStrip->strip;
00750     totalPH = 0;
00751 
00752     if( fDetector == Detector::kFar
00753         && !fStripIsXTalkEast[plane][strip] ) totalPH += ntpStrip->ph0.sigcor;
00754     if( !fStripIsXTalkWest[plane][strip] ) totalPH += ntpStrip->ph1.sigcor;
00755 
00756     if(totalPH >= 90.){
00757       MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
00758         << "plane " << plane << " strip " << ntpStrip->strip << " is ok "
00759         << fStripIsXTalkEast[plane][strip] << "/"
00760         << fStripIsXTalkWest[plane][strip] << " "
00761         << ntpStrip->ph0.sigcor << "/" << ntpStrip->ph1.sigcor << endl;
00762       ++stripsInPlane[(int)ntpStrip->plane];
00763     }
00764 
00765   }//end loop over event strips to see how many are in each plane
00766 
00767 
00768   // Now loop over all strips in the track
00769   // Count the number of strips in each plane for the track
00770   // Also sum up variables needed to fit t(z)
00771 
00772   for(Int_t i = 0; i < ntpTrack->nstrip; ++i){
00773 
00774     //get the NtpSRStrip object
00775     if (ntpTrack->stp[i] >= 0)
00776       ntpStrip = dynamic_cast<NtpSRStrip *>
00777         (fStripArray->At(ntpTrack->stp[i]));
00778     else continue;
00779     plane = (int)ntpStrip->plane;
00780     totalPH = 0;
00781 
00782     if( fDetector > 0 && !fStripIsXTalkEast[plane][strip] ) totalPH += ntpStrip->ph0.sigcor;
00783     if( !fStripIsXTalkWest[plane][strip] ) totalPH += ntpStrip->ph1.sigcor;
00784 
00785     if(totalPH >= 90.)  ++trkStripsInPlane[(int)ntpStrip->plane];
00786 
00787     if(fDetector == Detector::kFar
00788        && fStripIsXTalkEast[plane][strip] && fStripIsXTalkWest[plane][strip]){
00789       if((int)ntpStrip->planeview == kU) ++uXTalkStripCtr;
00790       else if((int)ntpStrip->planeview == kV) ++vXTalkStripCtr;
00791     }
00792     else if(fDetector == Detector::kNear && fStripIsXTalkWest[plane][strip]){
00793       if((int)ntpStrip->planeview == kU) ++uXTalkStripCtr;
00794       else if((int)ntpStrip->planeview == kV) ++vXTalkStripCtr;
00795     }
00796     //..................................................................
00797     if (ntpStrip->ph0.pe > 2.) {
00798       sumZ += ntpStrip->z;
00799       sumZ2 += ntpStrip->z * ntpStrip->z;
00800       sumZT += ntpStrip->z * ntpStrip->time0;
00801       sumT += ntpStrip->time0;
00802       ++nHits;
00803     }
00804 
00805     if (ntpStrip->ph1.pe > 2.) {
00806       sumZ += ntpStrip->z;
00807       sumZ2 += ntpStrip->z * ntpStrip->z;
00808       sumZT += ntpStrip->z * ntpStrip->time1;
00809       sumT += ntpStrip->time1;
00810       ++nHits;
00811     }
00812     //..................................................................
00813 
00814   } //end loop over strips in track
00815 
00816   trackInfo->xTalkStrips = uXTalkStripCtr+vXTalkStripCtr;
00817 
00818   //....................................................................
00819   // Calculate dtdz
00820   trackInfo->dtdz = 0;
00821   if (nHits > 1){  // VarZ == 0 if nHits == 1; next conditon would fail
00822     Double_t CovZT = sumZT - (sumZ*sumT)/(Float_t)nHits;
00823     Double_t VarZ = sumZ2 - (sumZ*sumZ)/(Float_t)nHits;
00824     if (VarZ > 0) trackInfo->dtdz = Munits::c_light * CovZT/VarZ;
00825   }
00826   //....................................................................
00827 
00828 
00829   //loop over all the planes and if the number of strips in the plane for
00830   //the track is the same as the number for the record, then it is a tracklike plane
00831   trackInfo->trackLikePlanes = 0;
00832   for(Int_t i = 0; i < 500; ++i){
00833 
00834     if(stripsInPlane[i]>0 && trkStripsInPlane[i]>0
00835        && stripsInPlane[i]*0.9 <= trkStripsInPlane[i])
00836       ++trackInfo->trackLikePlanes;
00837 
00838   }
00839 
00840 
00841   Int_t index = 0;
00842   Int_t nVPlanes = 0, nUPlanes = 0;
00843 
00844   nVPlanes = ntpTrack->plane.nv;
00845   nUPlanes = ntpTrack->plane.nu;
00846 
00847   trackInfo->uvAsymmetry = 0.;
00848   if(nVPlanes+nUPlanes>0)
00849     trackInfo->uvAsymmetry = TMath::Abs((1.*nUPlanes-1.*nVPlanes)/(1.*nVPlanes+1.*nUPlanes));
00850 
00851   trackInfo->signalUseFraction = 0.;
00852   if(eventInfo->pulseHeight>0.)
00853     trackInfo->signalUseFraction = trackInfo->pulseHeight/eventInfo->pulseHeight;
00854 
00855   trackInfo->planeUseFraction = 0.;
00856   if(eventInfo->planes>0)
00857     trackInfo->planeUseFraction = 1.*trackInfo->trackLikePlanes/(1.*eventInfo->planes);
00858 
00859   trackInfo->totalStrips = 0;
00860 
00861   //does the pathlength of the track make sense?
00862   if(trackInfo->length<50.){
00863 
00864     //loop over all strips in the track
00865     trackInfo->totalStrips = (int)ntpTrack->nstrip;
00866     numDoubleEndedStrips = 0;
00867 
00868     stpCtr = 0;
00869     //ntpStrip = dynamic_cast<NtpSRStrip *>(fStripArray->At(ntpTrack->stp[0]));
00870     for(Int_t ns = 0; ns < trackInfo->totalStrips; ++ns){
00871 
00872       //get the index for this strip
00873       if (ntpTrack->stp[ns] >= 0) index = ntpTrack->stp[ns];
00874       else continue;
00875       //get the NtpSRStrip object
00876       ntpStrip = dynamic_cast<NtpSRStrip *>(fStripArray->At(index));
00877       plane = (int)ntpStrip->plane;
00878       strip = (int)ntpStrip->strip;
00879       numDigits = (int)ntpStrip->ndigit;
00880 
00881       xPos = ntpTrack->stpx[ns];
00882       yPos = ntpTrack->stpy[ns];
00883       zPos = ntpTrack->stpz[ns];
00884 
00885       if(numDigits == 2){
00886 
00887         ++numDoubleEndedStrips;
00888 
00889       } // end if the strip had double sided readout
00890     } // end loop over strips in the track
00891 
00892     trackInfo->twoEndStripFraction = 0.;
00893     if(trackInfo->totalStrips>0)
00894       trackInfo->twoEndStripFraction = (1.*numDoubleEndedStrips)/(1.*trackInfo->totalStrips);
00895 
00896   }//end if reasonable track length
00897 
00898   //fill rustem's pid parameter here. Using new interface.
00899   trackInfo->kNN = fAnpInterface->GetVar("knn_pid",ntpEvent);
00900   trackInfo->numScintPlanes = fAnpInterface->GetVar("knn_01",ntpEvent);
00901   trackInfo->meanSigCor = fAnpInterface->GetVar("knn_10",ntpEvent);
00902   trackInfo->meanLowStripDivHighStrip = fAnpInterface->GetVar("knn_20",ntpEvent);
00903   trackInfo->trackSigCorFraction = fAnpInterface->GetVar("knn_40",ntpEvent);
00904 
00905   return;
00906 }

void ANtpInfoObjectFillerNC::FindEarlyActivityWeight NtpSREvent ntpEvent,
ANtpEventInfoNC eventInfo
[private]
 

Definition at line 1562 of file ANtpInfoObjectFillerNC.cxx.

References ANtpEventInfoNC::earlyWeightedADC, MSG, NtpSREvent::nstrip, NtpSRStrip::ph1, NtpSRStrip::plane, NtpSRStrip::pmtindex1, ANtpEventInfo::pulseHeight, NtpSRPulseHeight::sigcor, NtpSREvent::stp, and NtpSRStrip::time1.

Referenced by FillEventInformation().

01564 {
01565 
01566   //find the time of the earliest strip in the event
01567   double earliestEventTime = 1.e20;
01568   map<int,int> eventPlanes;
01569   NtpSRStrip *strip = 0;
01570 
01571   for(int i = 0; i < ntpEvent->nstrip; ++i){
01572     if (ntpEvent->stp[i] >= 0)
01573       strip = dynamic_cast<NtpSRStrip *>
01574         (fStripArray->At(ntpEvent->stp[i]));
01575     else continue;
01576     if(strip->time1 < earliestEventTime) earliestEventTime = strip->time1;
01577     if(eventPlanes.find(strip->pmtindex1) == eventPlanes.end()) eventPlanes[strip->pmtindex1] = 1;
01578 
01579   }
01580 
01581 //   for(int i = 0; i < ntpEvent->nstrip; ++i){
01582 //     strip = dynamic_cast<NtpSRStrip *>(fStripArray->At(ntpEvent->stp[i]));
01583 
01584 //     MSG("ANtpInfoObjectFillerNC", Msg::kInfo)
01585 //       << fHeaderInfo->snarl << " " << fHeaderInfo->events
01586 //       << " " << eventInfo->event << " "
01587 //       <<strip->plane << " " << earliestEventTime
01588 //       << " " << 1.e9*(strip->time1-earliestEventTime) << endl;
01589 //   }
01590 
01591   //now find the weigthed sum of ADC for the early strips - make sure the early
01592   //strips come from the same pmts as the event strips.
01593 
01594   double weightSum = 0.;
01595   for(int i = 0; i < fStripArray->GetLast()+1; ++i){
01596 
01597     strip = dynamic_cast<NtpSRStrip *>(fStripArray->At(i));
01598 
01599     //work in ns
01600     if(1.e9*(earliestEventTime - strip->time1) > 0.
01601        && 1.e9*(earliestEventTime - strip->time1) < 1000.*1.5
01602        && eventPlanes.find(strip->pmtindex1) != eventPlanes.end()){
01603       weightSum += strip->ph1.sigcor*TMath::Exp(-1.e9*(earliestEventTime - strip->time1)/700.);
01604 
01605       MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01606         << strip->pmtindex1 << " " << strip->plane
01607         << " " << strip->ph1.sigcor
01608         << " " << 1.e9*(earliestEventTime-strip->time1)
01609         << " " << weightSum
01610         << " " << eventInfo->pulseHeight << endl;
01611 
01612     }
01613   }
01614 
01615   eventInfo->earlyWeightedADC = weightSum;
01616 
01617   return;
01618 }

Float_t ANtpInfoObjectFillerNC::FindNearestNeighborPixelSignal Int_t  plane,
Int_t  pixel,
Int_t  pmt,
Float_t  planePixelSignal[][64][2]
[private]
 

Definition at line 1621 of file ANtpInfoObjectFillerNC.cxx.

References MSG.

Referenced by FindXTalkStrips().

01623 {
01624   MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01625     << "in FindNearestNeighborPixelSignal" << endl;
01626 
01627   Float_t sumNeighborSignal = 0.;
01628 
01629   if(fDetector == Detector::kFar){
01630     if(pixel == 5 || pixel == 6 || pixel == 9 || pixel == 10)
01631       sumNeighborSignal = (planePixelSignal[plane][pixel-4][pmt] + planePixelSignal[plane][pixel+4][pmt]
01632                            + planePixelSignal[plane][pixel-1][pmt] + planePixelSignal[plane][pixel+1][pmt]);
01633     else if(pixel < 3 && pixel > 0)
01634       sumNeighborSignal = (planePixelSignal[plane][pixel-1][pmt] + planePixelSignal[plane][pixel+1][pmt]
01635                            + planePixelSignal[plane][pixel+4][pmt]);
01636     else if(pixel < 15 && pixel > 12)
01637       sumNeighborSignal = (planePixelSignal[plane][pixel-1][pmt] + planePixelSignal[plane][pixel+1][pmt]
01638                            + planePixelSignal[plane][pixel-4][pmt]);
01639     else if(pixel > 3 && pixel < 15 && (pixel+1)%4 == 0)
01640       sumNeighborSignal = (planePixelSignal[plane][pixel-4][pmt] + planePixelSignal[plane][pixel+4][pmt]
01641                            + planePixelSignal[plane][pixel-1][pmt]);
01642 
01643     else if(pixel > 3 && pixel < 12 && pixel%4 == 0)
01644       sumNeighborSignal = (planePixelSignal[plane][pixel-4][pmt] + planePixelSignal[plane][pixel+4][pmt]
01645                            + planePixelSignal[plane][pixel+1][pmt]);
01646     else if(pixel == 0)
01647       sumNeighborSignal = planePixelSignal[plane][pixel+4][pmt] + planePixelSignal[plane][pixel+1][pmt];
01648 
01649     else if(pixel == 3)
01650       sumNeighborSignal = planePixelSignal[plane][pixel+4][pmt] + planePixelSignal[plane][pixel-1][pmt];
01651 
01652     else if(pixel == 12)
01653       sumNeighborSignal = planePixelSignal[plane][pixel-4][pmt] + planePixelSignal[plane][pixel+1][pmt];
01654 
01655     else if(pixel == 15)
01656       sumNeighborSignal = planePixelSignal[plane][pixel-4][pmt] + planePixelSignal[plane][pixel-1][pmt];
01657 
01658   }//end if far detector
01659   else if(fDetector == Detector::kNear){
01660 
01661     if( (pixel > 8 && pixel < 15) || (pixel > 16 && pixel < 23)
01662         || (pixel > 24 && pixel < 31) || (pixel > 32 && pixel < 39)
01663         || (pixel > 40 && pixel < 47) || (pixel > 48 && pixel < 55) )
01664       sumNeighborSignal = (planePixelSignal[plane][pixel-8][pmt] + planePixelSignal[plane][pixel+8][pmt]
01665                            + planePixelSignal[plane][pixel-1][pmt] + planePixelSignal[plane][pixel+1][pmt]);
01666     else if( pixel > 0 && pixel < 7)
01667       sumNeighborSignal = (planePixelSignal[plane][pixel-1][pmt] + planePixelSignal[plane][pixel+1][pmt]
01668                            + planePixelSignal[plane][pixel+8][pmt]);
01669     else if( pixel > 56 && pixel < 63)
01670       sumNeighborSignal = (planePixelSignal[plane][pixel-1][pmt] + planePixelSignal[plane][pixel+1][pmt]
01671                            + planePixelSignal[plane][pixel-8][pmt]);
01672     else if( pixel > 8 && pixel < 63 && (pixel+1)%8==0 )
01673       sumNeighborSignal = (planePixelSignal[plane][pixel-8][pmt] + planePixelSignal[plane][pixel+8][pmt]
01674                            + planePixelSignal[plane][pixel-1][pmt]);
01675     else if( pixel > 7 && pixel < 56 && (pixel)%8==0 )
01676       sumNeighborSignal = (planePixelSignal[plane][pixel-8][pmt] + planePixelSignal[plane][pixel+8][pmt]
01677                            + planePixelSignal[plane][pixel+1][pmt]);
01678     else if(pixel==0)
01679       sumNeighborSignal = planePixelSignal[plane][pixel+8][pmt] + planePixelSignal[plane][pixel+1][pmt];
01680     else if(pixel==7)
01681       sumNeighborSignal = planePixelSignal[plane][pixel+8][pmt] + planePixelSignal[plane][pixel-1][pmt];
01682     else if(pixel==56)
01683       sumNeighborSignal = planePixelSignal[plane][pixel-8][pmt] + planePixelSignal[plane][pixel+1][pmt];
01684     else if(pixel==63)
01685       sumNeighborSignal = planePixelSignal[plane][pixel-8][pmt] + planePixelSignal[plane][pixel-1][pmt];
01686   }
01687 
01688   return sumNeighborSignal;
01689 }

void ANtpInfoObjectFillerNC::FindXTalkStrips NtpSREvent ntpEvent  )  [private]
 

Definition at line 1692 of file ANtpInfoObjectFillerNC.cxx.

References FindNearestNeighborPixelSignal(), fPlanePixelEastSignal, fPlanePixelWestSignal, fPlaneToPMTMapEast, fPlaneToPMTMapWest, fStripIsXTalkEast, fStripIsXTalkWest, fStripToPixelMapEast, fStripToPixelMapWest, MSG, NtpSREvent::nstrip, NtpSRStrip::ph0, NtpSRStrip::ph1, NtpSRStrip::plane, NtpSRStrip::pmtindex0, NtpSRStrip::pmtindex1, NtpSRPulseHeight::sigcor, NtpSREvent::stp, and NtpSRStrip::strip.

01693 {
01694   MSG("ANtpInfoObjectFillerNC", Msg::kDebug) << "in FindXTalkStrips" << endl;
01695 
01696   NtpSRStrip *ntpStrip = 0;
01697 
01698   Int_t plane = 0;
01699   Int_t pixelEast = 0;
01700   Int_t pmtEast = 0;
01701   Int_t pixelWest = 0;
01702   Int_t pmtWest = 0;
01703 
01704   for(Int_t ns = 0; ns < ntpEvent->nstrip; ++ns){
01705 
01706     //get the NtpSRStrip object
01707     if (ntpEvent->stp[ns] >= 0)
01708       ntpStrip = dynamic_cast<NtpSRStrip *>
01709         (fStripArray->At(ntpEvent->stp[ns]));
01710     else continue;
01711     plane = (int)ntpStrip->plane;
01712 
01713     if(fDetector == Detector::kFar){
01714       pixelEast = fStripToPixelMapEast[ntpStrip->strip];
01715       pmtEast = 0;
01716       if(fPlaneToPMTMapEast[plane] != ntpStrip->pmtindex0) pmtEast = 1;
01717 
01718       if(ntpStrip->ph0.sigcor < 0.1*FindNearestNeighborPixelSignal(plane, pixelEast,
01719                                                                    pmtEast, fPlanePixelEastSignal)
01720          || ntpStrip->ph0.sigcor < 90.){
01721         fStripIsXTalkEast[plane][ntpStrip->strip] = 1;
01722         MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01723           << "east plane " << plane << " strip " << ntpStrip->strip
01724           << " is xtalk " << ntpStrip->ph0.sigcor <<  endl;
01725       }
01726 
01727     }
01728 
01729     pixelWest = fStripToPixelMapWest[ntpStrip->strip];
01730     pmtWest = 0;
01731     if(fPlaneToPMTMapWest[plane] != ntpStrip->pmtindex1) pmtWest = 1;
01732 
01733     if(ntpStrip->ph1.sigcor < 0.1*FindNearestNeighborPixelSignal(plane, pixelWest,
01734                                                                  pmtWest, fPlanePixelWestSignal)
01735        || ntpStrip->ph1.sigcor < 90.){
01736 
01737       fStripIsXTalkWest[plane][ntpStrip->strip] = 1;
01738       MSG("ANtpInfoObjectFillerNC", Msg::kDebug)
01739         << "west plane " << plane << " strip " << ntpStrip->strip
01740         << " is xtalk " << ntpStrip->ph1.sigcor << endl;
01741     }
01742 
01743   }//end loop over strips
01744   return;
01745 }

void ANtpInfoObjectFillerNC::GetEvtVtxWithFixup ANtpRecoNtpManipulator ntpManipulator,
int &  vtxPlane,
float &  vtxZ
const [private]
 

Helper for FillEventTimingAndActivityInformation.

Definition at line 304 of file ANtpInfoObjectFillerNC.cxx.

References ANtpEventManipulator::GetEvent(), ANtpRecoNtpManipulator::GetEventManipulator(), ANtpRecoNtpManipulator::GetNtpStRecord(), ANtpEventManipulator::GetPrimaryShower(), ANtpEventManipulator::GetPrimaryTrack(), ANtpRecoNtpManipulator::GetReleaseMCType(), NtpSREvent::index, NtpSRPlane::n, NtpSREvent::ntrack, NtpSRShower::plane, NtpSRTrack::plane, NtpSRVertex::plane, NtpSRTrack::vtx, NtpSREvent::vtx, and NtpSRVertex::z.

Referenced by FillEventTimingAndActivityInformation().

00306 {
00307   ANtpEventManipulator* evtManip = ntpManipulator->GetEventManipulator();
00308   const NtpSREvent* ntpEvent = evtManip->GetEvent();
00309 
00310   vtxPlane = ntpEvent->vtx.plane;
00311   vtxZ = ntpEvent->vtx.z;
00312 
00313   //Correct cedar vertex bug
00314   const TString reco = ntpManipulator->GetReleaseMCType();
00315   const bool isCedar = reco.Contains("Cedar");
00316   if(isCedar){
00317     NtpVtxFinder::NtpVtxFinder vtxf;
00318     vtxf.SetTargetEvent(ntpEvent->index, ntpManipulator->GetNtpStRecord());
00319     if(vtxf.FindVertex() > 0){ // Take fixed vertex if possible
00320       vtxPlane = vtxf.VtxPlane();
00321       vtxZ = vtxf.VtxZ();
00322     }
00323   } // end if cedar
00324 
00325   const NtpSRShower* ntpShower = evtManip->GetPrimaryShower();
00326   const NtpSRTrack* ntpTrack = evtManip->GetPrimaryTrack();
00327 
00328   if(ntpTrack && ntpShower){
00329     if(ntpEvent->ntrack > 0 &&
00330        ntpTrack->plane.n > ntpShower->plane.n){
00331       vtxPlane = ntpTrack->vtx.plane;
00332       vtxZ = ntpTrack->vtx.z - 3.92 * Munits::cm;
00333     }
00334   }
00335 }

void ANtpInfoObjectFillerNC::GetStripEventTime const NtpSREvent ntpEvent,
int  vtxPlane,
float  vtxZ,
double &  evtTime,
double &  ToFCorrectedEvtTime
const [private]
 

Helper for FillEventTimingAndActivityInformation.

Definition at line 340 of file ANtpInfoObjectFillerNC.cxx.

References NtpSREvent::nstrip, NtpSRPulseHeight::pe, NtpSRStrip::ph1, NtpSRStrip::plane, NtpSREvent::stp, NtpSRStrip::time1, and NtpSRStrip::z.

Referenced by FillEventTimingAndActivityInformation().

00344 {
00345   vector<double> stpTimes;
00346 
00347   ToFCorrectedEvtTime = 0;
00348   Int_t tfcount=0;
00349   // loop over strips in current event
00350   for(int ns = 0; ns < ntpEvent->nstrip; ++ns){
00351     const int stpIdx = ntpEvent->stp[ns];
00352     if(stpIdx < 0) continue;
00353     const NtpSRStrip* ntpStrip = (NtpSRStrip*)fStripArray->At(stpIdx);
00354 
00355     if(ntpStrip->ph1.pe >=2) {
00356       ToFCorrectedEvtTime += ntpStrip->time1-
00357         (fabs(ntpStrip->z - vtxZ)/Munits::c_light);
00358       tfcount++;
00359     }
00360     // 5 plane window
00361     if(ntpStrip->plane >= vtxPlane &&
00362        ntpStrip->plane < vtxPlane + 5){
00363       stpTimes.push_back(ntpStrip->time1);
00364     }
00365   } // end for ns
00366 
00367    if(tfcount) ToFCorrectedEvtTime /= (double)tfcount;
00368    else ToFCorrectedEvtTime=ANtpDefVal::kDouble;
00369 
00370   // calculate strip time median for this event
00371   sort(stpTimes.begin(), stpTimes.end());
00372 
00373   if(stpTimes.size() % 2)
00374     evtTime = *(stpTimes.begin()+stpTimes.size()/2);
00375   else
00376     evtTime = ( *(stpTimes.begin()+stpTimes.size()/2)
00377                 + *(stpTimes.begin()+stpTimes.size()/2-1) )/2.;
00378 }

void ANtpInfoObjectFillerNC::InitializekNN ANtpRecoNtpManipulator ntpManipulator  ) 
 

Definition at line 629 of file ANtpInfoObjectFillerNC.cxx.

References base, Anp::Interface::Config(), fAnpInterface, Anp::Interface::FillSnarl(), fkNNSet, ANtpRecoNtpManipulator::GetNtpStRecord(), gSystem(), Registry::LockValues(), MSG, reg, and Registry::Set().

Referenced by CondensedNtpModuleNC::Ana(), and NuExtraction::ExtractNCInfo().

00630 {
00631 
00632   if(!fkNNSet){
00633 
00634     //set the location of the weight files based on the detector
00635     TString weightFileName = "knn.train.far.cedar.daikon.root";
00636     if(fDetector == Detector::kNear) weightFileName = "knn.train.near.cedar.daikon.root";
00637 
00638     TString base = getenv("SRT_PRIVATE_CONTEXT");
00639     TString ncutils = "/NCUtils/data/";
00640     if(base != "" && base != "."){
00641       //check that the private context director exists, if not use public context
00642       void *dirptr = gSystem->OpenDirectory(base+ncutils);
00643       if(!dirptr){
00644         base = getenv("SRT_PUBLIC_CONTEXT");
00645       }//end if private context doesnt exist
00646     }//end if private context is defined
00647     else base = getenv("SRT_PUBLIC_CONTEXT");
00648 
00649     //check that the public context exists, if not assert false
00650     if(base == ""){
00651       MSG("ANtpInfoObjectFillerNC", Msg::kFatal) << "no SRT_PUBLIC_CONTEXT set"
00652                                                  << endl;
00653       assert(false);
00654     }
00655 
00656     TString weightFilePath = base+ncutils+weightFileName;
00657 
00658     //   MSG("ANtpInfoObjectFillerNC", Msg::kInfo) << "kNN weight files "
00659     //                                      << weightFilePath << endl;
00660     TString baseConf = getenv("SRT_PUBLIC_CONTEXT");
00661 
00662     Registry reg;
00663     reg.Set("InterfaceConfigPath", baseConf+"/PhysicsNtuple/Config/Config2007Real.txt");
00664     reg.Set("FillkNNFilePath", weightFilePath);
00665 
00666     //These are the most recently trained files to use but only exist at fermilab
00667     //If you want run at fermilab uncomment the next 3 lines
00668 
00669     //reg.Set("FillkNNFilePath", "/afs/fnal.gov/files/home/room1/rustem/data/muon-knn/knn.physics.near.daikon_00.cedar_phy.L010z185i.root");
00670     //if(fDetector == Detector::kFar)
00671     //reg.Set("FillkNNFilePath", "/afs/fnal.gov/files/home/room1/rustem/data/muon-knn/knn.physics.far.daikon_00.cedar_phy.L010z185i.root");
00672 
00673     reg.LockValues();
00674 
00675     fAnpInterface = new Anp::Interface();
00676     fAnpInterface->Config(reg);
00677     fkNNSet = true;
00678   }
00679   fAnpInterface->FillSnarl(ntpManipulator->GetNtpStRecord());
00680 
00681   return;
00682 
00683 }

void ANtpInfoObjectFillerNC::ResetXTalkArrays  )  [private]
 

void ANtpInfoObjectFillerNC::SetClusterArray const TClonesArray *  clusters  ) 
 

Definition at line 240 of file ANtpInfoObjectFillerNC.cxx.

References fClusterArray.

Referenced by CondensedNtpModuleNC::Ana(), and NuExtraction::ExtractNCInfo().

00240                                                                          {
00241   fClusterArray = clusters;
00242 }

void ANtpInfoObjectFillerNC::SetDetector Detector::Detector_t  detector  ) 
 

Reimplemented from ANtpInfoObjectFiller.

Definition at line 231 of file ANtpInfoObjectFillerNC.cxx.

References FillStripToPixelMaps().

Referenced by CondensedNtpModuleNC::Ana(), and NuExtraction::ExtractNCInfo().

00232 {
00233   // Set the detector. Then fill the strip to pixel maps accordingly
00234   fDetector = detector;
00235   FillStripToPixelMaps();
00236   return;
00237 }


Member Data Documentation

Anp::Interface* ANtpInfoObjectFillerNC::fAnpInterface [private]
 

Definition at line 112 of file ANtpInfoObjectFillerNC.h.

Referenced by FillTrackInformation(), and InitializekNN().

std::vector<double> ANtpInfoObjectFillerNC::fAvgCCe [private]
 

Definition at line 121 of file ANtpInfoObjectFillerNC.h.

std::vector<double> ANtpInfoObjectFillerNC::fAvgCCmu [private]
 

Definition at line 122 of file ANtpInfoObjectFillerNC.h.

std::vector<double> ANtpInfoObjectFillerNC::fAvgCCtau [private]
 

Definition at line 123 of file ANtpInfoObjectFillerNC.h.

std::vector<double> ANtpInfoObjectFillerNC::fAvgNC [private]
 

Definition at line 124 of file ANtpInfoObjectFillerNC.h.

const TClonesArray* ANtpInfoObjectFillerNC::fClusterArray [private]
 

Definition at line 114 of file ANtpInfoObjectFillerNC.h.

Referenced by FillShowerInformation(), and SetClusterArray().

bool ANtpInfoObjectFillerNC::fkNNSet [private]
 

Definition at line 116 of file ANtpInfoObjectFillerNC.h.

Referenced by InitializekNN().

std::vector<double> ANtpInfoObjectFillerNC::fPCCe [private]
 

Definition at line 125 of file ANtpInfoObjectFillerNC.h.

std::vector<double> ANtpInfoObjectFillerNC::fPCCmu [private]
 

Definition at line 126 of file ANtpInfoObjectFillerNC.h.

std::vector<double> ANtpInfoObjectFillerNC::fPCCtau [private]
 

Definition at line 127 of file ANtpInfoObjectFillerNC.h.

Int_t ANtpInfoObjectFillerNC::fPlaneCoverage[486] [private]
 

Definition at line 110 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FillStripToPixelMaps().

Float_t ANtpInfoObjectFillerNC::fPlanePixelEastSignal[486][64][2] [private]
 

Definition at line 106 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FindXTalkStrips().

Float_t ANtpInfoObjectFillerNC::fPlanePixelWestSignal[486][64][2] [private]
 

Definition at line 107 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FindXTalkStrips().

Int_t ANtpInfoObjectFillerNC::fPlaneToPMTMapEast[486] [private]
 

Definition at line 97 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FindXTalkStrips().

Int_t ANtpInfoObjectFillerNC::fPlaneToPMTMapWest[486] [private]
 

Definition at line 96 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FindXTalkStrips().

std::vector<double> ANtpInfoObjectFillerNC::fPNC [private]
 

Definition at line 128 of file ANtpInfoObjectFillerNC.h.

Int_t ANtpInfoObjectFillerNC::fStripIsXTalkEast[486][192] [private]
 

Definition at line 109 of file ANtpInfoObjectFillerNC.h.

Referenced by FillEventInformation(), FillShowerInformation(), FillTrackInformation(), and FindXTalkStrips().

Int_t ANtpInfoObjectFillerNC::fStripIsXTalkWest[486][192] [private]
 

Definition at line 108 of file ANtpInfoObjectFillerNC.h.

Referenced by FillEventInformation(), FillShowerInformation(), FillTrackInformation(), and FindXTalkStrips().

Int_t ANtpInfoObjectFillerNC::fStripToPixelMapEast[192] [private]
 

Definition at line 99 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), FillStripToPixelMaps(), and FindXTalkStrips().

Int_t ANtpInfoObjectFillerNC::fStripToPixelMapNearU1[64] [private]
 

Definition at line 100 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FillStripToPixelMaps().

Int_t ANtpInfoObjectFillerNC::fStripToPixelMapNearU2[64] [private]
 

Definition at line 102 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FillStripToPixelMaps().

Int_t ANtpInfoObjectFillerNC::fStripToPixelMapNearU3[64] [private]
 

Definition at line 104 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FillStripToPixelMaps().

Int_t ANtpInfoObjectFillerNC::fStripToPixelMapNearV1[64] [private]
 

Definition at line 101 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FillStripToPixelMaps().

Int_t ANtpInfoObjectFillerNC::fStripToPixelMapNearV2[64] [private]
 

Definition at line 103 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FillStripToPixelMaps().

Int_t ANtpInfoObjectFillerNC::fStripToPixelMapNearV3[64] [private]
 

Definition at line 105 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), and FillStripToPixelMaps().

Int_t ANtpInfoObjectFillerNC::fStripToPixelMapWest[192] [private]
 

Definition at line 98 of file ANtpInfoObjectFillerNC.h.

Referenced by FillPlanePixelSignalArrays(), FillStripToPixelMaps(), and FindXTalkStrips().

std::vector<double> ANtpInfoObjectFillerNC::fVarCCe [private]
 

Definition at line 129 of file ANtpInfoObjectFillerNC.h.

std::vector<double> ANtpInfoObjectFillerNC::fVarCCmu [private]
 

Definition at line 130 of file ANtpInfoObjectFillerNC.h.

std::vector<double> ANtpInfoObjectFillerNC::fVarCCtau [private]
 

Definition at line 131 of file ANtpInfoObjectFillerNC.h.

std::vector<double> ANtpInfoObjectFillerNC::fVarNC [private]
 

Definition at line 132 of file ANtpInfoObjectFillerNC.h.

int ANtpInfoObjectFillerNC::fVHSPlanes [private]
 

Definition at line 119 of file ANtpInfoObjectFillerNC.h.

int ANtpInfoObjectFillerNC::fVHSStrips [private]
 

Definition at line 120 of file ANtpInfoObjectFillerNC.h.


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 05:30:19 2009 for loon by  doxygen 1.3.9.1