SntpHelpers Namespace Reference

Functions

NtpSREventGetEvent (int evnt, RecRecordImp< RecCandHeader > *rri)
NtpSRTrackGetTrack (int trkn, RecRecordImp< RecCandHeader > *rri)
NtpSRShowerGetShower (int shwn, RecRecordImp< RecCandHeader > *rri)
NtpSRClusterGetCluster (int clun, RecRecordImp< RecCandHeader > *rri)
NtpSRStripGetStrip (int stpn, RecRecordImp< RecCandHeader > *rri)
NtpSRShieldSummaryshieldSummary (RecRecordImp< RecCandHeader > *rri)
NtpSRShieldStripGetShieldStrip (int stpn, RecRecordImp< RecCandHeader > *rri)
NtpSREventGetEvent (int evnt, NtpSRRecord *sr)
NtpSRTrackGetTrack (int trkn, NtpSRRecord *sr)
NtpSRShowerGetShower (int shwn, NtpSRRecord *sr)
NtpSRClusterGetCluster (int clun, NtpSRRecord *sR)
NtpSRSliceGetSlice (int slcn, NtpSRRecord *sr)
NtpSRStripGetStrip (int stpn, NtpSRRecord *sr)
NtpSRShieldSummaryshieldSummary (NtpSRRecord *sr)
NtpSRShieldStripGetShieldStrip (int stpn, NtpSRRecord *sr)
NtpSRShowerGetPrimaryShower (int evnt, RecRecordImp< RecCandHeader > *rri)
NtpSREventGetEvent (int evnt, NtpStRecord *st)
NtpSRTrackGetTrack (int trkn, NtpStRecord *st)
NtpSRTrackGetPrimaryTrack (int evtn, NtpStRecord *st)
NtpSRShowerGetShower (int shwn, NtpStRecord *st)
NtpSRClusterGetCluster (int clun, NtpStRecord *st)
NtpSRSliceGetSlice (int slcn, NtpStRecord *st)
NtpSRStripGetStrip (int stpn, NtpStRecord *st)
NtpSRShieldSummaryshieldSummary (NtpStRecord *st)
NtpSRShieldStripGetShieldStrip (int stpn, NtpStRecord *st)
int GetStripIndex (int stpn, TObject *obj)
int GetTrackIndex (int trkn, NtpSREvent *event)
int GetShowerIndex (int shwn, NtpSREvent *event)
int GetClusterIndex (int clun, NtpSRShower *shower)
NtpMCTruthGetMCTruth (int evnt, NtpMCRecord *mc)
NtpMCTruthGetMCTruth (int evnt, NtpStRecord *st)
std::vector< NtpMCStdHep * > GetStdHepArray (int evnt, NtpMCRecord *mc)
std::vector< NtpMCStdHep * > GetStdHepArray (int evnt, NtpStRecord *st)
int GetEvent2MCIndex (int evnt, NtpTHRecord *th)
int GetEvent2MCIndex (int evnt, NtpStRecord *st)
Int_t InPartialRegion (UShort_t plane, UShort_t strip)
NtpMREventGetMREvent (int ind, NtpMRRecord *mr)
NtpMRTruthGetMRTruth (int ind, NtpMRRecord *mr)
void FillEventEnergy (float *ph0, float *ph1, int evtn, NtpStRecord *st, const int SIZE)

Function Documentation

void SntpHelpers::FillEventEnergy ( float *  ph0,
float *  ph1,
int  evtn,
NtpStRecord st,
const int  SIZE 
)

Definition at line 690 of file SntpHelpers.cxx.

References GetEvent(), GetShower(), GetShowerIndex(), GetStripIndex(), GetTrack(), GetTrackIndex(), Msg::kFatal, MSG, NtpSRTrack::nstrip, NtpSRShower::nstrip, NtpSRTrack::stpph0mip, NtpSRShower::stpph0mip, NtpSRShower::stpph1mip, and NtpSRTrack::stpph1mip.

Referenced by NueModule::Analyze(), and NueDisplayModule::GetEvent().

00691 {
00692    NtpSREvent *event = 0;
00693    event = SntpHelpers::GetEvent(evtn,st);
00694    if(event == 0) return;
00695                                                                                 
00696    for(int j=0;j<event->ntrack;j++){
00697      int tindex = SntpHelpers::GetTrackIndex(j,event);
00698      NtpSRTrack *track = SntpHelpers::GetTrack(tindex,st);
00699      for(int k = 0; k < track->nstrip; k++){
00700         int index = SntpHelpers::GetStripIndex(k, track);
00701         if(index > SIZE){
00702           MSG("SntpHelper",Msg::kFatal)<<" evt mip array insufficiently large: "
00703               <<"index "<<index<<"/"<<SIZE<<" requested"<<std::endl;
00704         }
00705                                                                                 
00706         float mips1 = track->stpph1mip[k];
00707         float mips0 = track->stpph0mip[k];
00708                                                                                 
00709         if(ph0[index] < 0)   ph0[index] = mips0;
00710         if(ph1[index] < 0)   ph1[index] = mips1;
00711        }
00712     }
00713     for(int j=0;j<event->nshower;j++){
00714        int sindex = SntpHelpers::GetShowerIndex(j,event);
00715        NtpSRShower *shw = SntpHelpers::GetShower(sindex,st);
00716        for(int k = 0; k < shw->nstrip; k++){
00717           int index = SntpHelpers::GetStripIndex(k, shw);
00718           if(index > SIZE){
00719           MSG("SntpHelper",Msg::kFatal)<<" evt mip array insufficiently large: "
00720               <<"index "<<index<<"/"<<SIZE<<" requested"<<std::endl;
00721           }
00722                                                                                 
00723           float mips1 = shw->stpph1mip[k];
00724           float mips0 = shw->stpph0mip[k];
00725                                                                                 
00726           if(ph0[index] < 0)   ph0[index] = mips0;
00727           if(ph1[index] < 0)   ph1[index] = mips1;
00728        }
00729     }
00730     return;
00731 }

NtpSRCluster * SntpHelpers::GetCluster ( int  clun,
NtpStRecord st 
)

Definition at line 360 of file SntpHelpers.cxx.

References NtpStRecord::clu, NtpStRecord::evthdr, and NtpSREventSummary::ncluster.

00361 {
00362    NtpSRCluster *cluster=0;
00363    if(st==0){
00364       return cluster;
00365    }
00366    if(clun>=st->evthdr.ncluster){
00367       return cluster;
00368    }
00369 
00370    cluster = dynamic_cast<NtpSRCluster *>((*st->clu)[clun]);
00371 
00372    return cluster;
00373 }

NtpSRCluster * SntpHelpers::GetCluster ( int  clun,
NtpSRRecord sR 
)

Definition at line 213 of file SntpHelpers.cxx.

References NtpSRRecord::clu, NtpSRRecord::evthdr, and NtpSREventSummary::ncluster.

00214 {
00215    NtpSRCluster *cluster=0;
00216    if(sr==0){
00217       return cluster;
00218    }
00219    if(clun>=sr->evthdr.ncluster){
00220       return cluster;
00221    }
00222 
00223    cluster = dynamic_cast<NtpSRCluster *>((*sr->clu)[clun]);
00224 
00225    return cluster;
00226 }

NtpSRCluster * SntpHelpers::GetCluster ( int  clun,
RecRecordImp< RecCandHeader > *  rri 
)

Definition at line 112 of file SntpHelpers.cxx.

References Munits::sr.

Referenced by SubShowerVarAna::Analyze(), NueDisplayModule::FillClusterGraphs(), and AlgTrackCamList::Join2DTracks().

00113 {
00114   NtpStRecord *st=dynamic_cast<NtpStRecord *>(rri);
00115   if(st!=0){
00116     return GetCluster(clun,st);
00117   }
00118 
00119   NtpSRRecord *sr=dynamic_cast<NtpSRRecord *>(rri);
00120   if(sr!=0){
00121     return GetCluster(clun,sr);
00122   }
00123   return 0;
00124 }

int SntpHelpers::GetClusterIndex ( int  clun,
NtpSRShower shower 
)

Definition at line 518 of file SntpHelpers.cxx.

References NtpSRShower::clu, and NtpSRShower::ncluster.

Referenced by NueDisplayModule::FillClusterGraphs().

00519 {
00520    if(clun>=shower->ncluster){
00521       return -1;
00522    }
00523    else{
00524       return shower->clu[clun];
00525    }
00526    return -1;
00527 }

NtpSREvent * SntpHelpers::GetEvent ( int  evnt,
NtpStRecord st 
)

Definition at line 285 of file SntpHelpers.cxx.

References NtpStRecord::evt, NtpStRecord::evthdr, and NtpSREventSummary::nevent.

00286 {
00287    NtpSREvent *event=0;
00288    if(st==0){
00289       return event;
00290    }
00291    if(evnt>=st->evthdr.nevent){
00292       return event;
00293    }
00294 
00295    event = dynamic_cast<NtpSREvent *>((*st->evt)[evnt]);
00296 
00297    return event;
00298 }

NtpSREvent * SntpHelpers::GetEvent ( int  evnt,
NtpSRRecord sr 
)

Definition at line 168 of file SntpHelpers.cxx.

References NtpSRRecord::evt, NtpSRRecord::evthdr, and NtpSREventSummary::nevent.

00169 {
00170    NtpSREvent *event=0;
00171    if(sr==0){
00172       return event;
00173    }
00174    if(evnt>=sr->evthdr.nevent){
00175       return event;
00176    }
00177 
00178    event = dynamic_cast<NtpSREvent *>((*sr->evt)[evnt]);
00179 
00180    return event;
00181 }

NtpSREvent * SntpHelpers::GetEvent ( int  evnt,
RecRecordImp< RecCandHeader > *  rri 
)
int SntpHelpers::GetEvent2MCIndex ( int  evnt,
NtpStRecord st 
)

Definition at line 540 of file SntpHelpers.cxx.

References NtpTHEvent::neumc, and NtpStRecord::thevt.

00541 {
00542    int thsize=st->thevt->GetEntries();
00543    if(evnt>=thsize){
00544       return -1;
00545    }
00546    NtpTHEvent *the = dynamic_cast<NtpTHEvent *>((*st->thevt)[evnt]);
00547    return the->neumc;
00548    
00549 }

int SntpHelpers::GetEvent2MCIndex ( int  evnt,
NtpTHRecord th 
)

Definition at line 529 of file SntpHelpers.cxx.

References NtpTHEvent::neumc, and NtpTHRecord::thevt.

Referenced by NueHandScan::Ana(), MNtpModule::Ana(), NueSensitivity::Ana(), NueReadTJPID::Ana(), MCFluxInfoAna::Analyze(), NueXsecWeightAna::Analyze(), NueFluxWeightsAna::Analyze(), NueDisplayModule::GetBasicInfo(), and NueDisplayModule::plotmc().

00530 {
00531    int thsize=th->thevt->GetEntries();
00532    if(evnt>=thsize){
00533       return -1;
00534    }
00535    NtpTHEvent *the = dynamic_cast<NtpTHEvent *>((*th->thevt)[evnt]);
00536    return the->neumc;
00537    
00538 }

NtpMCTruth * SntpHelpers::GetMCTruth ( int  evnt,
NtpStRecord st 
)

Definition at line 567 of file SntpHelpers.cxx.

References NtpStRecord::mc.

00568 {
00569    NtpMCTruth *mct=0;
00570    
00571    if(index>=st->mc->GetEntries()){
00572       return mct;
00573    }
00574    if(index<0){
00575      return mct;
00576    }
00577    
00578    mct=dynamic_cast<NtpMCTruth *>((*st->mc)[index]);
00579    return mct;
00580 
00581 }

NtpMCTruth * SntpHelpers::GetMCTruth ( int  evnt,
NtpMCRecord mc 
)

Definition at line 551 of file SntpHelpers.cxx.

References NtpMCRecord::mc.

Referenced by NueHandScan::Ana(), MNtpModule::Ana(), NueSensitivity::Ana(), NueReadTJPID::Ana(), MCFluxInfoAna::Analyze(), NueFluxWeightsAna::Analyze(), and NueDisplayModule::GetBasicInfo().

00552 {
00553    NtpMCTruth *mct=0;
00554    
00555    if(index>=mc->mc->GetEntries()){
00556       return mct;
00557    }
00558    if(index<0){
00559      return mct;
00560    }
00561    
00562    mct=dynamic_cast<NtpMCTruth *>((*mc->mc)[index]);
00563    return mct;
00564 
00565 }

NtpMREvent * SntpHelpers::GetMREvent ( int  ind,
NtpMRRecord mr 
)

Definition at line 667 of file SntpHelpers.cxx.

References NtpMRRecord::mrevt, NtpMRRecord::mrhdr, and NtpMRSummary::nmrevt.

Referenced by NueModule::Analyze(), MuonRemovalInfoAna::Analyze(), NueDisplayModule::CreateMRMap(), NueDisplayModule::GenerateMRMultiGraphs(), ParticleFinder::Reco(), and NueDisplayModule::UpdateMRInformation().

00668 {
00669    NtpMREvent *mrevt=0;
00670    if(mr==0){
00671       return mrevt;
00672    }
00673    if(ind>=(int)(mr->mrhdr.nmrevt)){
00674       return mrevt;
00675    }
00676    mrevt = dynamic_cast<NtpMREvent *>((*mr->mrevt)[ind]);
00677    return mrevt;
00678 }

NtpMRTruth * SntpHelpers::GetMRTruth ( int  ind,
NtpMRRecord mr 
)

Definition at line 680 of file SntpHelpers.cxx.

References RecRecordImp< T >::GetHeader(), VldContext::GetSimFlag(), RecHeader::GetVldContext(), NtpMRRecord::mrhdr, NtpMRRecord::mrtru, and NtpMRSummary::nmrevt.

Referenced by MuonRemovalInfoAna::Analyze().

00681 {
00682    NtpMRTruth *mrtru=0;
00683    if(mr==0) return mrtru;
00684    if(mr->GetHeader().GetVldContext().GetSimFlag()!=4) return mrtru;
00685    if(ind>=(int)(mr->mrhdr.nmrevt)) return mrtru;
00686    mrtru = dynamic_cast<NtpMRTruth *>((*mr->mrtru)[ind]);
00687    return mrtru;
00688 }

NtpSRShower * SntpHelpers::GetPrimaryShower ( int  evnt,
RecRecordImp< RecCandHeader > *  rri 
)

Definition at line 74 of file SntpHelpers.cxx.

References GetEvent(), and GetShower().

00075 {
00076    NtpSRShower *shower=0;
00077    if(rri==0){
00078       return shower;
00079    }
00080 
00081    NtpSREvent *event = SntpHelpers::GetEvent(evnt,rri);
00082 /*   return SntpHelpers::GetPrimaryShower(event, rri);
00083 }
00084 
00085 NtpSRShower *GetPrimaryShower(NtpSREvent* evt, RecRecordImp<RecCandHeader> *rri)
00086 {
00087    NtpSRShower *shower=0;
00088    if(rri==0){
00089       return shower;
00090    }
00091                                                                                 
00092    NtpSREvent *event = evt;
00093 */
00094    if (event==0){
00095        return shower;
00096    }
00097                                                                                 
00098    Int_t nshws = event->nshower;
00099    if (nshws){//at least one shower
00100      if(event->primshw < 0){
00101 //        cout<<"Event has no primray shower but "<<nshws<<" showers."<<endl;
00102          return shower;
00103      }
00104      int index = event->shw[event->primshw];
00105 //     cout<<"Taking shower at "<<event->primshw<<" points to  "<<index<<endl;
00106      if(index < 0) return shower;
00107      shower = SntpHelpers::GetShower(index,rri);
00108    }
00109    return shower;
00110 }

NtpSRTrack * SntpHelpers::GetPrimaryTrack ( int  evtn,
NtpStRecord st 
)

Definition at line 316 of file SntpHelpers.cxx.

References NtpSRPlane::beg, NtpSRPlane::end, GetEvent(), GetTrack(), and NtpSRTrack::plane.

00317 {
00318    NtpSRTrack *ntpTrack=0;
00319    NtpSRTrack *primaryTrack = 0;
00320    if(st==0){ return ntpTrack; }
00321    NtpSREvent* event = SntpHelpers::GetEvent(evtn,st);
00322   
00323    int length = 0;
00324    int tmpLength = 0;
00325 
00326    for(int i = 0; i < event->ntrack; i++){
00327      int index = event->trk[i];
00328      ntpTrack = SntpHelpers::GetTrack(index, st);
00329      if(!primaryTrack) primaryTrack = ntpTrack;
00330                                                                                 
00331      tmpLength = TMath::Abs(ntpTrack->plane.end - ntpTrack->plane.beg);
00332                                                                                 
00333      if(tmpLength > length){
00334        length = tmpLength;
00335        primaryTrack = ntpTrack;
00336      }
00337    }
00338                              
00339    return primaryTrack;
00340 }

NtpSRShieldStrip * SntpHelpers::GetShieldStrip ( int  stpn,
NtpStRecord st 
)

Definition at line 417 of file SntpHelpers.cxx.

References NtpSRShieldSummary::ishit, NtpSRShieldSummary::ndigit, NtpStRecord::vetohdr, and NtpStRecord::vetostp.

00418 {
00419    NtpSRShieldStrip *strip=0;
00420    if(st==0){
00421       return strip;
00422    }
00423    int nshdigt = st->vetohdr.ndigit[0]+st->vetohdr.ndigit[1]+st->vetohdr.ndigit[2];
00424    if(st->vetohdr.ishit==0||stpn>=nshdigt){
00425       return strip;
00426    }
00427 
00428    strip = dynamic_cast<NtpSRShieldStrip *>((*st->vetostp)[stpn]);
00429 
00430    return strip;
00431 }

NtpSRShieldStrip * SntpHelpers::GetShieldStrip ( int  stpn,
NtpSRRecord sr 
)

Definition at line 270 of file SntpHelpers.cxx.

References NtpSRShieldSummary::ishit, NtpSRShieldSummary::ndigit, NtpSRRecord::vetohdr, and NtpSRRecord::vetostp.

00271 {
00272    NtpSRShieldStrip *strip=0;
00273    if(sr==0){
00274       return strip;
00275    }
00276    int nshdigt = sr->vetohdr.ndigit[0]+sr->vetohdr.ndigit[1]+sr->vetohdr.ndigit[2];
00277    if(sr->vetohdr.ishit==0||stpn>=nshdigt){
00278       return strip;
00279    }
00280    strip = dynamic_cast<NtpSRShieldStrip *>((*sr->vetostp)[stpn]);
00281 
00282    return strip;
00283 }

NtpSRShieldStrip * SntpHelpers::GetShieldStrip ( int  stpn,
RecRecordImp< RecCandHeader > *  rri 
)

Definition at line 154 of file SntpHelpers.cxx.

References Munits::sr.

Referenced by ShieldRejVarAna::Analyze().

00155 {
00156   NtpStRecord *st=dynamic_cast<NtpStRecord *>(rri);
00157   if(st!=0){
00158     return GetShieldStrip(stpn,st);
00159   }
00160 
00161   NtpSRRecord *sr=dynamic_cast<NtpSRRecord *>(rri);
00162   if(sr!=0){
00163     return GetShieldStrip(stpn,sr);
00164   }
00165     return 0;
00166 }

NtpSRShower * SntpHelpers::GetShower ( int  shwn,
NtpStRecord st 
)

Definition at line 344 of file SntpHelpers.cxx.

References NtpStRecord::evthdr, NtpSREventSummary::nshower, and NtpStRecord::shw.

00345 {
00346    NtpSRShower *shower=0;
00347    if(st==0){
00348       return shower;
00349    }
00350    if(shwn>=st->evthdr.nshower){
00351       return shower;
00352    }
00353 
00354 
00355    shower = dynamic_cast<NtpSRShower *>((*st->shw)[shwn]);
00356 
00357    return shower;
00358 }

NtpSRShower * SntpHelpers::GetShower ( int  shwn,
NtpSRRecord sr 
)

Definition at line 198 of file SntpHelpers.cxx.

References NtpSRRecord::evthdr, NtpSREventSummary::nshower, and NtpSRRecord::shw.

00199 {
00200    NtpSRShower *shower=0;
00201    if(sr==0){
00202       return shower;
00203    }
00204    if(shwn>=sr->evthdr.nshower){
00205       return shower;
00206    }
00207 
00208    shower = dynamic_cast<NtpSRShower *>((*sr->shw)[shwn]);
00209 
00210    return shower;
00211 }

NtpSRShower * SntpHelpers::GetShower ( int  shwn,
RecRecordImp< RecCandHeader > *  rri 
)
int SntpHelpers::GetShowerIndex ( int  shwn,
NtpSREvent event 
)
NtpSRSlice * SntpHelpers::GetSlice ( int  slcn,
NtpStRecord st 
)

Definition at line 375 of file SntpHelpers.cxx.

References NtpStRecord::evthdr, NtpSREventSummary::nslice, and NtpStRecord::slc.

00376 {
00377    NtpSRSlice *slice=0;
00378    if(st==0){
00379       return slice;
00380    }
00381    if(slcn>=st->evthdr.nslice){
00382       return slice;
00383    }
00384 
00385    slice = dynamic_cast<NtpSRSlice *>((*st->slc)[slcn]);
00386 
00387    return slice;
00388 }

NtpSRSlice * SntpHelpers::GetSlice ( int  slcn,
NtpSRRecord sr 
)

Definition at line 228 of file SntpHelpers.cxx.

References NtpSRRecord::evthdr, NtpSREventSummary::nslice, and NtpSRRecord::slc.

Referenced by TimingVarsAna::Analyze(), NueDisplayModule::GenerateOverlayMultiGraphs(), and NueDisplayModule::GetEvent().

00229 {
00230    NtpSRSlice *slice=0;
00231    if(sr==0){
00232       return slice;
00233    }
00234    if(slcn>=sr->evthdr.nslice){
00235       return slice;
00236    }
00237 
00238    slice = dynamic_cast<NtpSRSlice *>((*sr->slc)[slcn]);
00239 
00240    return slice;
00241 }

std::vector< NtpMCStdHep * > SntpHelpers::GetStdHepArray ( int  evnt,
NtpStRecord st 
)

Definition at line 595 of file SntpHelpers.cxx.

References NtpMCStdHep::mc, and NtpStRecord::stdhep.

00596 {
00597    std::vector<NtpMCStdHep *> v;
00598    for(int i=0;i<st->stdhep->GetEntries();i++){
00599       NtpMCStdHep *stdhep = dynamic_cast<NtpMCStdHep *>((*st->stdhep)[i]);
00600       if(stdhep->mc==index){
00601          v.push_back(stdhep);
00602       }
00603    }
00604    return v;
00605 }

std::vector< NtpMCStdHep * > SntpHelpers::GetStdHepArray ( int  evnt,
NtpMCRecord mc 
)

Definition at line 583 of file SntpHelpers.cxx.

References NtpMCStdHep::mc, and NtpMCRecord::stdhep.

Referenced by NueDisplayModule::DrawInteractionDiagram(), and NueDisplayModule::plotmc().

00584 {
00585    std::vector<NtpMCStdHep *> v;
00586    for(int i=0;i<mc->stdhep->GetEntries();i++){
00587       NtpMCStdHep *stdhep = dynamic_cast<NtpMCStdHep *>((*mc->stdhep)[i]);
00588       if(stdhep->mc==index){
00589          v.push_back(stdhep);
00590       }
00591    }
00592    return v;
00593 }

NtpSRStrip * SntpHelpers::GetStrip ( int  stpn,
NtpStRecord st 
)

Definition at line 390 of file SntpHelpers.cxx.

References NtpStRecord::evthdr, NtpSREventSummary::nstrip, and NtpStRecord::stp.

00391 {
00392    NtpSRStrip *strip=0;
00393    if(st==0){
00394       return strip;
00395    }
00396    if(stpn>=(int)(st->evthdr.nstrip) || stpn < 0){
00397       return strip;
00398    }
00399 
00400    strip = dynamic_cast<NtpSRStrip *>((*st->stp)[stpn]);
00401 
00402    return strip;
00403 }

NtpSRStrip * SntpHelpers::GetStrip ( int  stpn,
NtpSRRecord sr 
)

Definition at line 243 of file SntpHelpers.cxx.

References NtpSRRecord::evthdr, NtpSREventSummary::nstrip, and NtpSRRecord::stp.

00244 {
00245    NtpSRStrip *strip=0;
00246    if(sr==0){
00247       return strip;
00248    }
00249    if(stpn>=(int)(sr->evthdr.nstrip)){
00250       return strip;
00251    }
00252 
00253    strip = dynamic_cast<NtpSRStrip *>((*sr->stp)[stpn]);
00254 
00255    return strip;
00256 }

NtpSRStrip * SntpHelpers::GetStrip ( int  stpn,
RecRecordImp< RecCandHeader > *  rri 
)

Definition at line 126 of file SntpHelpers.cxx.

References Munits::sr.

00127 {
00128   NtpStRecord *st=dynamic_cast<NtpStRecord *>(rri);
00129   if(st!=0){
00130     return GetStrip(stpn,st);
00131   }
00132 
00133   NtpSRRecord *sr=dynamic_cast<NtpSRRecord *>(rri);
00134   if(sr!=0){
00135     return GetStrip(stpn,sr);
00136   }
00137     return 0;
00138 }

int SntpHelpers::GetStripIndex ( int  stpn,
TObject *  obj 
)

Definition at line 433 of file SntpHelpers.cxx.

References NtpSRCluster::nstrip, NtpSRTrack::nstrip, NtpSRShower::nstrip, NtpSRSlice::nstrip, NtpSRShower::stp, NtpSRSlice::stp, NtpSRCluster::stp, and NtpSRTrack::stp.

Referenced by ShwfitAna::Analyze(), ANtpInfoObjectFillerNue::Analyze(), EventQualAna::Analyze(), HitCalcAna::ComputeHits(), ANtpTrackInfoAna::DetermineSigInOut(), ShwfitAna::doSlopes(), NueDisplayModule::FillClusterGraphs(), FillEventEnergy(), ANtpInfoObjectFillerNue::FillEventEnergy(), NueDisplayModule::FillEventGraph(), ANtpShowerInfoAna::FillGapInformation(), MSTCalcAna::FillHitSets(), ANtpEventInfoAna::FillStripVariables(), VtxFinderAna::FindClosest(), NtpVtxFinder::FindVertexTime(), NtpVtxFinder::FindVtxPlane(), NtpVtxFinder::FindVtxUV(), NueDisplayModule::GenerateOverlayMultiGraphs(), NueDisplayModule::GetEvent(), and AngClusterAna::WeightedEnergy().

00434 {
00435    //this may be a stupid way of doing this, but it's the only way I can think of
00436    //we may want to do this for other reco objects in the future
00437   if(obj==0){
00438     return -1;
00439   }
00440 
00441    const char* cn = obj->ClassName();
00442 
00443    if(strcmp(cn,"NtpSREvent")==0){
00444       NtpSREvent *event = dynamic_cast<NtpSREvent *>(obj);
00445       if(stpn>=event->nstrip){
00446          return -1;
00447       }
00448       else{
00449          return event->stp[stpn];
00450       }
00451    }
00452    else if(strcmp(cn,"NtpSRTrack")==0){
00453       NtpSRTrack *track = dynamic_cast<NtpSRTrack *>(obj);
00454       if(stpn>=track->nstrip){
00455          return -1;
00456       }
00457       else{
00458          return track->stp[stpn];
00459       }
00460    }
00461    else if(strcmp(cn,"NtpSRShower")==0){
00462       NtpSRShower *shower = dynamic_cast<NtpSRShower *>(obj);
00463       if(stpn>=shower->nstrip){
00464          return -1;
00465       }
00466       else{
00467          return shower->stp[stpn];
00468       }
00469 
00470    }
00471    else if(strcmp(cn,"NtpSRCluster")==0){
00472       NtpSRCluster *cluster = dynamic_cast<NtpSRCluster *>(obj);
00473       if(stpn>=cluster->nstrip){
00474          return -1;
00475       }
00476       else{
00477          return cluster->stp[stpn];
00478       }
00479 
00480    }else  if(strcmp(cn,"NtpSRSlice")==0){
00481       NtpSRSlice *slice = dynamic_cast<NtpSRSlice *>(obj);
00482       if(stpn>=slice->nstrip){
00483          return -1;
00484       }
00485       else{
00486          return slice->stp[stpn];
00487       }
00488    }
00489    else{
00490       return -1;
00491    }
00492 
00493    return -1;
00494 }

NtpSRTrack * SntpHelpers::GetTrack ( int  trkn,
NtpStRecord st 
)

Definition at line 300 of file SntpHelpers.cxx.

References NtpStRecord::evthdr, NtpSREventSummary::ntrack, and NtpStRecord::trk.

00301 {
00302    NtpSRTrack *track=0;
00303    if(st==0){
00304       return track;
00305    }
00306    if(trkn>=st->evthdr.ntrack){
00307       return track;
00308    }
00309 
00310 
00311    track = dynamic_cast<NtpSRTrack *>((*st->trk)[trkn]);
00312 
00313    return track;
00314 }

NtpSRTrack * SntpHelpers::GetTrack ( int  trkn,
NtpSRRecord sr 
)

Definition at line 183 of file SntpHelpers.cxx.

References NtpSRRecord::evthdr, NtpSREventSummary::ntrack, and NtpSRRecord::trk.

00184 {
00185    NtpSRTrack *track=0;
00186    if(sr==0){
00187       return track;
00188    }
00189    if(trkn>=sr->evthdr.ntrack){
00190       return track;
00191    }
00192 
00193    track = dynamic_cast<NtpSRTrack *>((*sr->trk)[trkn]);
00194 
00195    return track;
00196 }

NtpSRTrack * SntpHelpers::GetTrack ( int  trkn,
RecRecordImp< RecCandHeader > *  rri 
)
int SntpHelpers::GetTrackIndex ( int  trkn,
NtpSREvent event 
)
Int_t SntpHelpers::InPartialRegion ( UShort_t  plane,
UShort_t  strip 
)

Definition at line 607 of file SntpHelpers.cxx.

00607                                                                 {
00608   // figure out if this (plane,strip) corresponds to something in
00609   // the partially instrumented region
00610   //
00611   // this region is defined as:
00612   // v planes: (strip<=4 || strip>=67)
00613   // partial u: (strip==0 || strip=63)
00614   // full u: (strip<=26 || strip>=88) 
00615   //
00616   // if so, return 1
00617   // if not, return -1
00618   // if error, return 0
00619 
00620 
00621   // make a lookup ptype to hold the type of each plane
00622   // 1 = v partial   2 = u partial
00623   // 3 = v full   4 = u full
00624   // 0 = uninstrumented
00625   static bool first=true;
00626   static UShort_t ptype[282];
00627   if(first){
00628     ptype[0]=0;
00629     for(int i=1; i<=281; i++){
00630       if(i%2==0) ptype[i]=1; // a v plane
00631       else ptype[i]=2; // a u plane
00632       if((i-1)%5 == 0) ptype[i]+=2; // fully instrumented
00633       else if(i>120) ptype[i]=0; // not instrumented
00634     }
00635     first=false;
00636   }
00637   if(plane>281){
00638     //    std::cerr<<"InPartialRegion passed plane = "<<plane<<std::endl;
00639     return 0;
00640   }
00641   UShort_t pt = ptype[plane];
00642   
00643   Int_t result;
00644   switch(pt){
00645   case 1:
00646   case 3:
00647     if(strip<=4 || strip>=67) result=1;
00648     else result = -1;
00649     break;
00650   case 2:
00651     if(strip==0 || strip == 63) result=1;
00652     else result = -1;
00653     break;
00654   case 4:
00655     if(strip<=26 || strip>=88) result=1;
00656     else result = -1;
00657     break;
00658   case 0:
00659   default:
00660     result=0;
00661     break;
00662   }
00663   return result;
00664 
00665 }

NtpSRShieldSummary * SntpHelpers::shieldSummary ( NtpStRecord st  ) 

Definition at line 405 of file SntpHelpers.cxx.

References NtpStRecord::vetohdr.

00406 {
00407    NtpSRShieldSummary *shsm=0;
00408    if(st==0){
00409       return shsm;
00410    }
00411 
00412    shsm = dynamic_cast<NtpSRShieldSummary *>(&st->vetohdr);
00413 
00414    return shsm;
00415 }

NtpSRShieldSummary * SntpHelpers::shieldSummary ( NtpSRRecord sr  ) 

Definition at line 258 of file SntpHelpers.cxx.

References NtpSRRecord::vetohdr.

00259 {
00260    NtpSRShieldSummary *shsm=0;
00261    if(sr==0){
00262       return shsm;
00263    }
00264 
00265    shsm = dynamic_cast<NtpSRShieldSummary *>(&sr->vetohdr);
00266 
00267    return shsm;
00268 }

NtpSRShieldSummary * SntpHelpers::shieldSummary ( RecRecordImp< RecCandHeader > *  rri  ) 

Definition at line 140 of file SntpHelpers.cxx.

References Munits::sr.

00141 {
00142   NtpStRecord *st=dynamic_cast<NtpStRecord *>(rri);
00143   if(st!=0){
00144     return shieldSummary(st);
00145   }
00146 
00147   NtpSRRecord *sr=dynamic_cast<NtpSRRecord *>(rri);
00148   if(sr!=0){
00149     return shieldSummary(sr);
00150   }
00151     return 0;
00152 }


Generated on 14 Dec 2017 for loon by  doxygen 1.6.1