#include <AlgFitTrackCamList.h>
Inheritance diagram for AlgFitTrackCamList:

Public Member Functions | |
| AlgFitTrackCamList () | |
| virtual | ~AlgFitTrackCamList () |
| virtual void | RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx) |
| virtual void | Trace (const char *c) const |
| void | CleanNDSlices (CandRecord *candrec) |
| void | CheckWeights (CandRecord *candrec) |
|
|
Definition at line 45 of file AlgFitTrackCamList.cxx. 00046 {
00047 }
|
|
|
Definition at line 52 of file AlgFitTrackCamList.cxx. 00053 {
00054 }
|
|
|
Definition at line 214 of file AlgFitTrackCamList.cxx. References digit(), CandDigitHandle::DupHandle(), CandRecord::FindCandHandle(), CandHandle::GetDaughterIterator(), CandStripHandle::GetPlane(), and CandDigitHandle::GetPlexSEIdAltLWritable(). Referenced by RunAlg(). 00215 {
00216 // Make sure that the weights in the list of alternative PlexSEIds are
00217 // good after the ND Spectrometer DeMuxing is complete
00218 CandStripListHandle* StripList = dynamic_cast<CandStripListHandle *>
00219 (candrec->FindCandHandle("CandStripListHandle"));
00220
00221 if(StripList) {
00222 CandStripHandleItr stripItr(StripList->GetDaughterIterator());
00223
00224 for (CandStripHandle* strip=stripItr(); strip ; strip=stripItr()) {
00225 if(strip->GetPlane()<121) {continue;}
00226
00227 CandDigitHandleItr digitItr(strip->GetDaughterIterator());
00228
00229 for (CandDigitHandle* digit=digitItr(); digit ; digit=digitItr()) {
00230 CandDigitHandle* newdig=digit->DupHandle();
00231
00232 PlexSEIdAltL& newaltl=newdig->GetPlexSEIdAltLWritable();
00233
00234 for(unsigned int i=0; i<newaltl.size(); ++i) {
00235 if(newaltl[i].GetWeight()>0) {newaltl[i].SetWeight((float)1.);}
00236 }
00237 }
00238 }
00239 }
00240 }
|
|
|
Definition at line 170 of file AlgFitTrackCamList.cxx. References CandRecord::FindCandHandle(), CandHandle::GetDaughterIterator(), CandStripHandle::GetPlane(), CandHandle::IsEqual(), CandHandle::IsSlushyEnabled(), CandHandle::RemoveDaughter(), and CandHandle::SetSlushyEnabled(). Referenced by RunAlg(). 00171 {
00172 // Check that there is nothing in slicelist that isn't in striplist
00173 bool SlushyOnEntry = CandHandle::IsSlushyEnabled();
00174 vector<CandStripHandle*> StripsToRemove;
00175
00176 CandHandle::SetSlushyEnabled(kTRUE);
00177
00178 CandStripListHandle* StripList = dynamic_cast<CandStripListHandle *>
00179 (candrec->FindCandHandle("CandStripListHandle"));
00180
00181 CandSliceListHandle* SliceList = dynamic_cast<CandSliceListHandle *>
00182 (candrec->FindCandHandle("CandSliceListHandle"));
00183
00184
00185 if(SliceList && StripList) {
00186 CandSliceHandleItr sliceItr(SliceList->GetDaughterIterator());
00187
00188 for (CandSliceHandle* Slice=sliceItr(); Slice ; Slice=sliceItr()) {
00189 CandStripHandleItr SliceStripItr(Slice->GetDaughterIterator());
00190
00191 for (CandStripHandle* SliceStrip=SliceStripItr(); SliceStrip; SliceStrip=SliceStripItr()) {
00192 bool found = false;
00193
00194 if(SliceStrip->GetPlane()>120){
00195 CandStripHandleItr stripItr(StripList->GetDaughterIterator());
00196
00197 for (CandStripHandle* strip=stripItr(); strip ; strip=stripItr()) {
00198 if(strip->IsEqual(SliceStrip)) {found=true; break;}
00199 }
00200 if(!found) {StripsToRemove.push_back(SliceStrip);}
00201 }
00202 }
00203 for(unsigned int i=0; i<StripsToRemove.size(); ++i) {Slice->RemoveDaughter(StripsToRemove[i]);}
00204 StripsToRemove.clear();
00205 }
00206 }
00207
00208 if(!SlushyOnEntry) {CandHandle::SetSlushyEnabled(kFALSE);}
00209 }
|
|
||||||||||||||||
|
Implements AlgBase. Definition at line 59 of file AlgFitTrackCamList.cxx. References CandHandle::AddDaughterLink(), CheckWeights(), CleanNDSlices(), AlgFactory::GetAlgHandle(), CandContext::GetCandRecord(), CandContext::GetDataIn(), CandHandle::GetDaughterIterator(), VldContext::GetDetector(), AlgFactory::GetInstance(), CandContext::GetMom(), CandHandle::GetNDaughters(), RecMinos::GetVldContext(), CandFitTrackCam::MakeCandidate(), MSG, CandContext::SetCandRecord(), CandFitTrackHandle::SetCPUTime(), CandContext::SetDataIn(), CandHandle::SetName(), and CandHandle::SetTitle(). 00060 {
00061 assert(cx.GetDataIn());
00062
00063 // Check for CandTrackListHandle input
00064 if (cx.GetDataIn()->InheritsFrom("CandTrackListHandle"))
00065 {
00066 const CandTrackListHandle *ctlh = dynamic_cast<const CandTrackListHandle*>(cx.GetDataIn());
00067 const MomNavigator *mom = cx.GetMom();
00068
00069 CandRecord* candrec = (CandRecord*)(cx.GetCandRecord());
00070 assert(candrec);
00071
00072 VldContext* vldc = (VldContext*)(candrec->GetVldContext());
00073 Detector::Detector_t detector = vldc->GetDetector();
00074
00075
00076 // Create the new tracklist
00078 CandFitTrackCamListHandle& tracklist = dynamic_cast<CandFitTrackCamListHandle&>(ch);
00079 if( !ctlh || ctlh->GetNDaughters()<1 ) {
00080 // Require number of CandTracks to be non-zero to do anything more
00081 MSG("AlgFitTrackCamList", Msg::kWarning) << " !ctlh || ctlh->GetNDaughters()<1 " << endl;
00082 return;
00083 }
00085
00086
00087
00088 // Make sure we pass the finder track with most strips to the fitter first of all
00089 // (important for ND Spectrometer DeMuxing)
00091 TIter trackItr(ctlh->GetDaughterIterator());
00092
00093 int* NFinderStrips = new int[ctlh->GetNDaughters()];
00094 int index; int MaxFinderStrips; int id;
00095
00096 for(index=0; index<ctlh->GetNDaughters(); ++index) {NFinderStrips[index]=-1;}
00097 index=0;
00098
00099 while (CandTrackHandle *track = dynamic_cast<CandTrackHandle*>(trackItr()))
00100 {NFinderStrips[index]=track->GetNDaughters(); ++index;}
00102
00103
00104
00105 // Set-up for calculating CPUTime
00107 clock_t dummyt;
00108 struct tms t1;
00109 struct tms t2;
00110 static double ticksPerSecond = sysconf(_SC_CLK_TCK);
00112
00113
00114
00115 // Now loop over the ordered list of tracks, carrying out the fit
00117 for(int k=0; k<ctlh->GetNDaughters(); ++k)
00118 {
00119 MaxFinderStrips=0; id=-1;
00120 for(index=0; index<ctlh->GetNDaughters(); ++index) {
00121 if(MaxFinderStrips<NFinderStrips[index]) {MaxFinderStrips=NFinderStrips[index]; id=index;}
00122 }
00123
00124 if(id>=0) {
00125 NFinderStrips[id]=-1; index=0; trackItr.Reset();
00126
00127 CandTrackHandle *track = 0;
00128
00129 while (CandTrackHandle *track1 = dynamic_cast<CandTrackHandle*>(trackItr())) {
00130 if(index==id) {track=track1; break;}
00131 ++index;
00132 }
00133
00134 if(track!=0) {
00135 AlgFactory &af = AlgFactory::GetInstance();
00136 AlgHandle ah_trk = af.GetAlgHandle("AlgFitTrackCam", "default");
00137
00138 // Create complete track
00139 CandContext cx0(this, mom);
00140 cx0.SetDataIn(track);
00141 cx0.SetCandRecord(candrec);
00142
00143 dummyt = times(&t1);
00144 CandFitTrackCamHandle cth = CandFitTrackCam::MakeCandidate(ah_trk, cx0);
00145 dummyt = times(&t2);
00146 cth.SetCPUTime((Double_t)(t2.tms_utime+t2.tms_stime-t1.tms_utime-t1.tms_stime)/ticksPerSecond);
00147
00148 cth.SetName(TString("CandFitTrackCamHandle"));
00149 cth.SetTitle(TString("Created by AlgFitTrackCamList"));
00150 // Add candtrack to candtracklist
00151 tracklist.AddDaughterLink(cth);
00152
00153 if(detector==Detector::kNear) {CleanNDSlices(candrec);}
00154 }
00155 }
00156 }
00157 delete[] NFinderStrips;
00158
00159 if(detector==Detector::kNear) {CheckWeights(candrec);}
00160
00162
00163 }
00164
00165 }
|
|
|
Reimplemented from AlgBase. Definition at line 245 of file AlgFitTrackCamList.cxx. 00246 {
00247 }
|
1.3.9.1