#include "StandardNtuple/NtpStRecord.h"#include "CandNtupleSR/NtpSRRecord.h"#include "CandNtupleSR/NtpSREvent.h"#include "CandNtupleSR/NtpSRTrack.h"#include "CandNtupleSR/NtpSRStrip.h"#include "CandNtupleSR/NtpSRSlice.h"Go to the source code of this file.
Namespaces | |
| namespace | VertexHelper |
Functions | |
| int | GetStripIndex (int stpn, NtpSRTrack *track) |
| int | GetStripIndex (int stpn, NtpSREvent *event) |
| int | GetStripIndex (int stpn, NtpSRSlice *slice) |
| NtpSRSlice * | GetSlice (int slcn, NtpStRecord *st) |
| NtpSREvent * | GetEvent (int evnt, NtpStRecord *st) |
| NtpSRTrack * | GetTrack (int trkn, NtpStRecord *st) |
| NtpSRStrip * | GetStrip (int stpn, NtpStRecord *st) |
| int | CalculateNTrkLike (NtpSRTrack *track, NtpStRecord *st) |
|
||||||||||||
|
Definition at line 60 of file VertexHelper.cxx. References NtpSRPlane::end, VertexHelper::GetSlice(), VertexHelper::GetStrip(), VertexHelper::GetStripIndex(), NtpSRTrack::nstrip, NtpSRSlice::nstrip, NtpSRPulseHeight::pe, NtpSRStrip::ph0, NtpSRStrip::ph1, NtpSRStrip::plane, NtpSRTrack::plane, NtpSRVertex::plane, NtpSRStrip::planeview, NtpSRTrack::slc, NtpSRTrack::stpu, NtpSRTrack::stpv, NtpSRStrip::strip, NtpSRTrack::vtx, and NtpSRStrip::z. Referenced by ANtpTrackInfoAna::Analyze(). 00061 {
00062 int sliceIndex = track->slc;
00063 if(sliceIndex < 0 ) return 0;
00064
00065 NtpSRSlice* slice = VertexHelper::GetSlice(sliceIndex, st);
00066
00067 int MinPlane = track->vtx.plane;
00068 int MaxPlane = track->plane.end;
00069
00070 double PEThreshold = 1.5; //1,5
00071 int MaxGap = 0; // default is 0
00072 int ntrklike = 0;
00073 int ntrkplane = 0;
00074 int striphit[500][192];
00075 float stripPE[500][192];
00076 for(int iplane=0;iplane<500;iplane++){
00077 for(int istrip=0;istrip<192;istrip++){
00078 striphit[iplane][istrip] = 0;
00079 stripPE[iplane][istrip] = 0;
00080 }
00081 }
00082
00083 for(int istrip=0; istrip < slice->nstrip;istrip++){
00084 int index = VertexHelper::GetStripIndex(istrip, slice);
00085 NtpSRStrip *strip = VertexHelper::GetStrip(index, st);
00086 if(strip == NULL) continue;
00087
00088 int slcstrip = strip->strip;
00089 int plane = strip->plane;
00090 if(slcstrip<192 && plane<500){
00091 striphit[plane][slcstrip] = 1;
00092 stripPE[plane][slcstrip] += strip->ph0.pe+strip->ph1.pe;
00093 }
00094 }
00095
00096 float trackslope=0;
00097 float lastz = 0;
00098 float lasttu = 0;
00099 float lasttv = 0;
00100 float thisz = 0;
00101 float thistu=0;
00102 float thistv=0;
00103 float delt=0;
00104 bool SetPos=false;
00105
00106 for(int iplane=MinPlane;iplane<=MaxPlane;iplane++){
00107 bool found = false;
00108 int index = -1;
00109 NtpSRStrip *strip = 0;
00110 for(int trkstrip=0; trkstrip< track->nstrip && !found; trkstrip++){
00111 int index = VertexHelper::GetStripIndex(trkstrip, track);
00112 strip = VertexHelper::GetStrip(index, st);
00113 if(strip == NULL) continue;
00114 if(strip->plane == iplane){
00115 found = true;
00116 }
00117 }
00118
00119 if(found){
00120 ntrkplane++;
00121 int stripstrip = strip->strip;
00122 thisz = strip->z;
00123 thistu = track->stpu[index];
00124 thistv = track->stpv[index];
00125
00126 if(strip->planeview==2){ delt = thistu-lasttu; }
00127 else { delt = thistv-lasttv; }
00128
00129 if(SetPos && thisz!=lastz) trackslope = TMath::Abs(delt/(thisz-lastz));
00130 int ncluster = 0;
00131 int ngap = 0;
00132 for(int stripInd=stripstrip;stripInd<192;stripInd++){
00133 if(striphit[iplane][stripInd] == 0){ ngap++; }
00134 else{
00135 if (stripPE[iplane][stripInd]>PEThreshold) ncluster++;
00136 ngap = 0;
00137 }
00138 if(ngap>MaxGap)break;
00139 }
00140 ngap=0;
00141
00142 for(int stripInd=stripstrip-1;stripInd>0;stripInd--){
00143 if(striphit[iplane][stripInd] == 0){ ngap++; }
00144 else{
00145 if (stripPE[iplane][stripInd]>PEThreshold) ncluster++;
00146 ngap = 0;
00147 }
00148 if(ngap>MaxGap)break;
00149 }
00150
00151 if(stripPE[iplane][stripstrip] <= PEThreshold) ncluster++;
00152
00153 int nexpect = 1 + (int) TMath::Abs(trackslope*0.25);
00154 if(ncluster<=nexpect+1 && ncluster>0) ntrklike++;
00155 lastz = thisz;
00156 lasttu = thistu;
00157 lasttv = thistv;
00158 SetPos = true;
00159 }
00160 }
00161 return ntrklike;
00162 }
|
|
||||||||||||
|
Definition at line 33 of file VertexHelper.cxx. References NtpStRecord::evt, NtpStRecord::evthdr, and NtpSREventSummary::nevent. Referenced by Lit::Find(), Lit::Print(), and NtpVtxFinder::SetTargetEvent(). 00034 {
00035 NtpSREvent *event=0;
00036 if(st==0 || evnt>=st->evthdr.nevent) return event;
00037 event = dynamic_cast<NtpSREvent *>((*st->evt)[evnt]);
00038 return event;
00039 }
|
|
||||||||||||
|
Definition at line 25 of file VertexHelper.cxx. References NtpStRecord::evthdr, NtpSREventSummary::nslice, and NtpStRecord::slc. Referenced by VertexHelper::CalculateNTrkLike(). 00026 {
00027 NtpSRSlice *slice=0;
00028 if(st==0 || slcn>=st->evthdr.nslice) return slice;
00029 slice = dynamic_cast<NtpSRSlice *>((*st->slc)[slcn]);
00030 return slice;
00031 }
|
|
||||||||||||
|
Definition at line 51 of file VertexHelper.cxx. References NtpStRecord::evthdr, NtpSREventSummary::nstrip, and NtpStRecord::stp. Referenced by VertexHelper::CalculateNTrkLike(), Managed::HitManager::ClearXTalk(), NtpVtxFinder::FindVertexTime(), and NtpSRBleachFiller::GetstraightPHFraction(). 00052 {
00053 NtpSRStrip *strip=0;
00054 if(st==0 || stpn >= (int)(st->evthdr.nstrip) || stpn < 0) {return strip; }
00055 strip = dynamic_cast<NtpSRStrip *>((*st->stp)[stpn]);
00056
00057 return strip;
00058 }
|
|
||||||||||||
|
Definition at line 13 of file VertexHelper.cxx. References NtpSRSlice::nstrip, and NtpSRSlice::stp. 00014 {
00015 if(slice == 0 || stpn >= slice->nstrip) return -1;
00016 return slice->stp[stpn];
00017 }
|
|
||||||||||||
|
Definition at line 19 of file VertexHelper.cxx. References NtpSREvent::nstrip, and NtpSREvent::stp. 00020 {
00021 if(event == 0 || stpn >= event->nstrip) return -1;
00022 return event->stp[stpn];
00023 }
|
|
||||||||||||
|
Definition at line 7 of file VertexHelper.cxx. References NtpSRTrack::nstrip, and NtpSRTrack::stp. Referenced by VertexHelper::CalculateNTrkLike(), and NtpVtxFinder::FindVertexTime(). 00008 {
00009 if(track == 0 || stpn >= track->nstrip) return -1;
00010 return track->stp[stpn];
00011 }
|
|
||||||||||||
|
Definition at line 41 of file VertexHelper.cxx. References NtpStRecord::evthdr, NtpSREventSummary::ntrack, and NtpStRecord::trk. Referenced by NtpVtxFinder::SetTargetEvent(). 00042 {
00043 NtpSRTrack *track=0;
00044 if(st==0 || trkn>=st->evthdr.ntrack) return track;
00045 track = dynamic_cast<NtpSRTrack *>((*st->trk)[trkn]);
00046 return track;
00047 }
|
1.3.9.1