#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 220 of file AlgFitTrackCamList.cxx. References digit(), CandDigitHandle::DupHandle(), CandRecord::FindCandHandle(), CandHandle::GetDaughterIterator(), CandStripHandle::GetPlane(), and CandDigitHandle::GetPlexSEIdAltLWritable(). Referenced by RunAlg(). 00221 {
00222 // Make sure that the weights in the list of alternative PlexSEIds are
00223 // good after the ND Spectrometer DeMuxing is complete
00224 CandStripListHandle* StripList = dynamic_cast<CandStripListHandle *>
00225 (candrec->FindCandHandle("CandStripListHandle"));
00226
00227 if(StripList) {
00228 CandStripHandleItr stripItr(StripList->GetDaughterIterator());
00229
00230 for (CandStripHandle* strip=stripItr(); strip ; strip=stripItr()) {
00231 if(strip->GetPlane()<121) {continue;}
00232
00233 CandDigitHandleItr digitItr(strip->GetDaughterIterator());
00234
00235 for (CandDigitHandle* digit=digitItr(); digit ; digit=digitItr()) {
00236 CandDigitHandle* newdig=digit->DupHandle();
00237
00238 PlexSEIdAltL& newaltl=newdig->GetPlexSEIdAltLWritable();
00239
00240 for(unsigned int i=0; i<newaltl.size(); ++i) {
00241 if(newaltl[i].GetWeight()>0) {newaltl[i].SetWeight((float)1.);}
00242 }
00243 }
00244 }
00245 }
00246 }
|
|
|
Definition at line 176 of file AlgFitTrackCamList.cxx. References CandRecord::FindCandHandle(), CandHandle::GetDaughterIterator(), CandStripHandle::GetPlane(), CandHandle::IsEqual(), CandHandle::IsSlushyEnabled(), CandHandle::RemoveDaughter(), and CandHandle::SetSlushyEnabled(). Referenced by RunAlg(). 00177 {
00178 // Check that there is nothing in slicelist that isn't in striplist
00179 bool SlushyOnEntry = CandHandle::IsSlushyEnabled();
00180 vector<CandStripHandle*> StripsToRemove;
00181
00182 CandHandle::SetSlushyEnabled(kTRUE);
00183
00184 CandStripListHandle* StripList = dynamic_cast<CandStripListHandle *>
00185 (candrec->FindCandHandle("CandStripListHandle"));
00186
00187 CandSliceListHandle* SliceList = dynamic_cast<CandSliceListHandle *>
00188 (candrec->FindCandHandle("CandSliceListHandle"));
00189
00190
00191 if(SliceList && StripList) {
00192 CandSliceHandleItr sliceItr(SliceList->GetDaughterIterator());
00193
00194 for (CandSliceHandle* Slice=sliceItr(); Slice ; Slice=sliceItr()) {
00195 CandStripHandleItr SliceStripItr(Slice->GetDaughterIterator());
00196
00197 for (CandStripHandle* SliceStrip=SliceStripItr(); SliceStrip; SliceStrip=SliceStripItr()) {
00198 bool found = false;
00199
00200 if(SliceStrip->GetPlane()>120){
00201 CandStripHandleItr stripItr(StripList->GetDaughterIterator());
00202
00203 for (CandStripHandle* strip=stripItr(); strip ; strip=stripItr()) {
00204 if(strip->IsEqual(SliceStrip)) {found=true; break;}
00205 }
00206 if(!found) {StripsToRemove.push_back(SliceStrip);}
00207 }
00208 }
00209 for(unsigned int i=0; i<StripsToRemove.size(); ++i) {Slice->RemoveDaughter(StripsToRemove[i]);}
00210 StripsToRemove.clear();
00211 }
00212 }
00213
00214 if(!SlushyOnEntry) {CandHandle::SetSlushyEnabled(kFALSE);}
00215 }
|
|
||||||||||||||||
|
Implements AlgBase. Definition at line 59 of file AlgFitTrackCamList.cxx. References CandHandle::AddDaughterLink(), CheckWeights(), CleanNDSlices(), Registry::Get(), 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
00137 const char *configname;
00138 AlgHandle ah_trk;
00139 if (ac.Get("AlgFitTrackCamConfig", configname))
00140 ah_trk = af.GetAlgHandle("AlgFitTrackCam", configname);
00141 else
00142 ah_trk = af.GetAlgHandle("AlgFitTrackCam", "default");
00143
00144 // Create complete track
00145 CandContext cx0(this, mom);
00146 cx0.SetDataIn(track);
00147 cx0.SetCandRecord(candrec);
00148
00149 dummyt = times(&t1);
00150 CandFitTrackCamHandle cth = CandFitTrackCam::MakeCandidate(ah_trk, cx0);
00151 dummyt = times(&t2);
00152 cth.SetCPUTime((Double_t)(t2.tms_utime+t2.tms_stime-t1.tms_utime-t1.tms_stime)/ticksPerSecond);
00153
00154 cth.SetName(TString("CandFitTrackCamHandle"));
00155 cth.SetTitle(TString("Created by AlgFitTrackCamList"));
00156 // Add candtrack to candtracklist
00157 tracklist.AddDaughterLink(cth);
00158
00159 if(detector==Detector::kNear) {CleanNDSlices(candrec);}
00160 }
00161 }
00162 }
00163 delete[] NFinderStrips;
00164
00165 if(detector==Detector::kNear) {CheckWeights(candrec);}
00166
00168
00169 }
00170
00171 }
|
|
|
Reimplemented from AlgBase. Definition at line 251 of file AlgFitTrackCamList.cxx. 00252 {
00253 }
|
1.3.9.1