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

Public Member Functions | |
| NtpMaker () | |
| ~NtpMaker () | |
| void | BeginJob () |
| JobCResult | Ana (const MomNavigator *mom) |
| const Registry & | DefaultConfig () const |
| void | Config (const Registry &r) |
| void | EndJob () |
Private Member Functions | |
| void | FillMCInfo (SimSnarlRecord *simrec) |
| void | FillRawInfo (RawRecord *rawrec) |
| void | FillCandInfo (CandRecord *candrec) |
| void | FillDataQualityInfo (TObject *tob) |
| void | FillDeMuxInfo (TObject *tob) |
| void | FillShieldInfo (TObject *tob) |
| void | FillStripInfo (TObject *tob) |
| void | FillSliceInfo (TObject *tob) |
| void | FillFitTrackInfo (TObject *tob) |
| void | FillTrackInfo (TObject *tob) |
| void | FillShowerInfo (TObject *tob) |
| void | FillEventInfo (TObject *tob) |
| void | FillSpillInfo (const VldContext &vldc) |
Private Attributes | |
| TFile * | fFile |
| TTree * | fTree |
| TString | fNtpName |
| Double_t | fMaxFileSizeBytes |
| Int_t | fFileNumber |
| Bool_t | fWriteStrips |
| Bool_t | fWriteScintHits |
| Bool_t | fWriteStdHEPs |
| AtmosEvent * | fEvent |
| vector< AtmosStrip > | fStrpList [500] |
|
|
Definition at line 80 of file NtpMaker.cxx. References fEvent, fFile, fFileNumber, fMaxFileSizeBytes, fNtpName, fTree, fWriteScintHits, fWriteStdHEPs, fWriteStrips, and MSG. 00081 {
00082 MSG("NtpMaker",Msg::kDebug) << " *** NtpMaker::NtpMaker() *** " << endl;
00083
00084 fFile = 0;
00085 fTree = 0;
00086 fNtpName = "ntp.root";
00087 fMaxFileSizeBytes = 0.0;
00088 fFileNumber = 1;
00089 fWriteStrips = true;
00090 fWriteScintHits = true;
00091 fWriteStdHEPs = true;
00092 fEvent = new AtmosEvent();
00093 }
|
|
|
Definition at line 97 of file NtpMaker.cxx. References MSG. 00098 {
00099 MSG("NtpMaker",Msg::kDebug) << " *** NtpMaker::~NtpMaker() *** " << endl;
00100 }
|
|
|
Implement this for read only access to the MomNavigator Reimplemented from JobCModule. Definition at line 112 of file NtpMaker.cxx. References AtmosEvent::Date, fEvent, fFile, fFileNumber, FillCandInfo(), FillMCInfo(), FillRawInfo(), fMaxFileSizeBytes, fNtpName, fTree, RerootExodus::GetEventNo(), MomNavigator::GetFragment(), RecMinos::GetHeader(), RawDaqSnarlHeader::GetNumRawDigits(), RawRecord::GetRawHeader(), RawDaqSnarlHeader::GetRemoteSpillType(), CandHeader::GetRun(), RawDaqHeader::GetRun(), RecDataHeader::GetRun(), RerootExodus::GetRunNo(), RawDaqHeader::GetRunType(), RecDataHeader::GetRunType(), VldContext::GetSimFlag(), SimSnarlRecord::GetSimSnarlHeader(), CandHeader::GetSnarl(), RawDaqSnarlHeader::GetSnarl(), RecPhysicsHeader::GetSnarl(), RawDaqHeader::GetSubRun(), RecDataHeader::GetSubRun(), RawDaqHeader::GetTimeFrameNum(), VldContext::GetTimeStamp(), RawDaqSnarlHeader::GetTrigSrc(), RecMinosHdr::GetVldContext(), RecMinos::GetVldContext(), RecRecordImp< T >::GetVldContext(), Calibrator::Instance(), AtmosEvent::MicroSec, MSG, AtmosEvent::NanoSec, AtmosEvent::Ndigits, AtmosEvent::NScintHits, AtmosEvent::NStdHEPs, AtmosEvent::NStrips, Calibrator::ReInitialise(), AtmosEvent::Reset(), AtmosEvent::Run, run(), AtmosEvent::RunType, AtmosEvent::ScintHitList, AtmosEvent::SimFlag, AtmosEvent::Snarl, AtmosEvent::SpillInfo, AtmosSpill::spilltype, AtmosEvent::StdHEPList, AtmosEvent::StripList, AtmosEvent::SubRun, AtmosEvent::Time, AtmosEvent::TimeFrame, AtmosEvent::TrigSrc, and AtmosEvent::UnixTime. 00113 {
00114 MSG("NtpMaker",Msg::kDebug) << " *** NtpMaker::Ana(...) *** " << endl;
00115
00116 JobCResult result(JobCResult::kPassed);
00117 Int_t simflag=-1;
00118 Int_t run=-1, subrun=-1, snarl=-1;
00119 Int_t runtype=-1, trigsrc=-1, timeframe=-1;
00120 Int_t date=-1, time=-1, microsec=-1, nanosec=-1, unixtime=-1;
00121 Int_t ndigits=-1;
00122 fEvent->Reset();
00123
00124 // Process the SimSnarlRecord
00125 SimSnarlRecord* simrec = dynamic_cast<SimSnarlRecord *>(mom->GetFragment("SimSnarlRecord"));
00126 if(simrec)
00127 {
00128 MSG("NtpMaker",Msg::kDebug) << " *** PROCESS SIMSNARLRECORD *** " << endl;
00129
00130 if(simflag<0) simflag = simrec->GetVldContext()->GetSimFlag();
00131
00132 if(run<0) run=RerootExodus::GetRunNo();
00133 if(snarl<0) snarl=RerootExodus::GetEventNo();
00134
00135 const SimSnarlHeader* hdr = dynamic_cast<const SimSnarlHeader*>(simrec->GetSimSnarlHeader());
00136 if(hdr)
00137 {
00138 if(run<0) run = hdr->GetRun();
00139 if(subrun<0) subrun = hdr->GetSubRun();
00140 if(snarl<0) snarl = hdr->GetSnarl();
00141 if(runtype<0) runtype = hdr->GetRunType();
00142 }
00143
00144 this->FillMCInfo(simrec);
00145 }
00146
00147 // Process the RawRecord
00148 RawRecord* rawrec = dynamic_cast<RawRecord*>(mom->GetFragment("RawRecord"));
00149 if(rawrec)
00150 {
00151 MSG("NtpMaker",Msg::kDebug) << " *** PROCESS RAWRECORD *** " << endl;
00152
00153 if(simflag<0) simflag = rawrec->GetVldContext()->GetSimFlag();
00154
00155 const RawDaqSnarlHeader* hdr = dynamic_cast<const RawDaqSnarlHeader*>(rawrec->GetRawHeader());
00156 if(hdr)
00157 {
00158
00159 if(run<0) run = hdr->GetRun();
00160 if(subrun<0) subrun = hdr->GetSubRun();
00161 if(snarl<0) snarl = hdr->GetSnarl();
00162 if(runtype<0) runtype = hdr->GetRunType();
00163 if(trigsrc<0) trigsrc = hdr->GetTrigSrc();
00164 if(timeframe<0) timeframe = hdr->GetTimeFrameNum();
00165 if(ndigits<0) ndigits = hdr->GetNumRawDigits();
00166 if(unixtime<0) unixtime = ((VldTimeStamp)(hdr->GetVldContext().GetTimeStamp())).GetSec();
00167 if(date<0) date = (((VldTimeStamp)(hdr->GetVldContext().GetTimeStamp())).GetSec()-1059696000)/(3600*24);
00168 if(time<0) time = (((VldTimeStamp)(hdr->GetVldContext().GetTimeStamp())).GetSec()-1059696000)%(3600*24);
00169 if(nanosec<0) nanosec = (Int_t)(1.000*(((VldTimeStamp)(hdr->GetVldContext().GetTimeStamp())).GetNanoSec()));
00170 if(microsec<0) microsec = (Int_t)(0.001*(((VldTimeStamp)(hdr->GetVldContext().GetTimeStamp())).GetNanoSec()));
00171 if(fEvent->SpillInfo.spilltype<0) fEvent->SpillInfo.spilltype = hdr->GetRemoteSpillType();
00172 }
00173 this->FillRawInfo(rawrec);
00174 }
00175
00176 // Process the CandRecord
00177 CandRecord* candrec = dynamic_cast<CandRecord*>(mom->GetFragment("CandRecord"));
00178 if(candrec)
00179 {
00180 MSG("NtpMaker",Msg::kDebug) << " *** PROCESS CANDRECORD *** " << endl;
00181
00182 if(simflag<0) simflag = candrec->GetVldContext()->GetSimFlag();
00183
00184 const CandHeader* hdr = dynamic_cast<const CandHeader*>(candrec->GetHeader());
00185 if(hdr)
00186 {
00187 Calibrator& cal = Calibrator::Instance();
00188 cal.ReInitialise(hdr->GetVldContext());
00189
00190 if(run<0) run = hdr->GetRun();
00191 if(snarl<0) snarl = hdr->GetSnarl();
00192 if(unixtime<0) unixtime = ((VldTimeStamp)(hdr->GetVldContext().GetTimeStamp())).GetSec();
00193 if(date<0) date = (((VldTimeStamp)(hdr->GetVldContext().GetTimeStamp())).GetSec()-1059696000)/(3600*24);
00194 if(time<0) time = (((VldTimeStamp)(hdr->GetVldContext().GetTimeStamp())).GetSec()-1059696000)%(3600*24);
00195 if(nanosec<0) nanosec = (Int_t)(1.000*(((VldTimeStamp)(hdr->GetVldContext().GetTimeStamp())).GetNanoSec()));
00196 if(microsec<0) microsec = (Int_t)(0.001*(((VldTimeStamp)(hdr->GetVldContext().GetTimeStamp())).GetNanoSec()));
00197 }
00198
00199 this->FillCandInfo(candrec);
00200 }
00201
00202 fEvent->Run = run;
00203 fEvent->SubRun = subrun;
00204 fEvent->Snarl = snarl;
00205 fEvent->RunType = runtype;
00206 fEvent->TrigSrc = trigsrc;
00207 fEvent->TimeFrame = timeframe;
00208 fEvent->Date = date;
00209 fEvent->Time = time;
00210 fEvent->MicroSec = microsec;
00211 fEvent->NanoSec = nanosec;
00212 fEvent->UnixTime = unixtime;
00213 fEvent->Ndigits = ndigits;
00214 fEvent->SimFlag = simflag;
00215
00216 MSG("NtpMaker",Msg::kDebug) << " *** EVENT SUMMARY *** " << endl
00217 << " Run = " << fEvent->Run << endl
00218 << " SubRun = " << fEvent->SubRun << endl
00219 << " Snarl = " << fEvent->Snarl << endl
00220 << " RunType = " << fEvent->RunType << endl
00221 << " TrigSrc = " << fEvent->TrigSrc << endl
00222 << " TimeFrame = " << fEvent->TimeFrame << endl
00223 << " Date = " << fEvent->Date << endl
00224 << " Time = " << fEvent->Time << endl
00225 << " MicroSec = " << fEvent->MicroSec << endl
00226 << " NanoSec = " << fEvent->NanoSec << endl
00227 << " UnixTime = " << fEvent->UnixTime << endl
00228 << " Ndigits = " << fEvent->Ndigits << endl
00229 << " SimFlag = " << fEvent->SimFlag << endl;
00230
00231
00232 MSG("NtpMaker",Msg::kInfo) << " *** NtpMaker: " << fEvent->Run << "/" << fEvent->SubRun << " " << fEvent->Snarl << " DONE *** " << endl;
00233
00234 //Check if user wants strips written to file.
00235 if (!fWriteStrips)
00236 {
00237 fEvent->NStrips = 0;
00238 fEvent->StripList->Clear();
00239 }
00240
00241 //Check if user wants strips written to file.
00242 if (!fWriteScintHits)
00243 {
00244 fEvent->NScintHits = 0;
00245 fEvent->ScintHitList->Clear();
00246 }
00247
00248 //Check if user wants strips written to file.
00249 if (!fWriteStdHEPs)
00250 {
00251 fEvent->NStdHEPs = 0;
00252 fEvent->StdHEPList->Clear();
00253 }
00254
00255 // create output file
00256 if(!fFile)
00257 {
00258 MSG("NtpMaker",Msg::kInfo) << " CREATING OUTPUT FILE: " << fNtpName.Data() << endl;
00259
00260 // create the output file
00261 TDirectory *tmpd = gDirectory;
00262 fFile = TFile::Open(fNtpName.Data(), "recreate");
00263 fTree = new TTree("ntp", "FarDet Atmos Events");
00264 fTree->SetDirectory(fFile);
00265 fTree->Branch("evt", "AtmosEvent", &fEvent);
00266 fTree->SetAutoSave(100);
00267 tmpd->cd();
00268 }
00269
00270 // re-create output file (at maximum file size)
00271 if( fFile
00272 && fMaxFileSizeBytes>0
00273 && fFile->GetBytesWritten()>fMaxFileSizeBytes )
00274 {
00275 MSG("NtpMaker",Msg::kWarning) << " FILE SIZE EXCEEDS LIMIT (" << 1.0e-6*fFile->GetBytesWritten() << ">" << 1.0e-6*fMaxFileSizeBytes << ")" << endl;
00276 MSG("NtpMaker",Msg::kWarning) << " ... SWITCHING TO NEW FILE" << endl;
00277
00278 // write out the current file
00279 TDirectory *tmpd = gDirectory;
00280 fFile->cd();
00281 fFile->Write();
00282 fFile->Close();
00283 gDirectory = tmpd;
00284
00285 // adjust the file name
00286 fFileNumber++;
00287 TDirectory *tmpd2 = gDirectory;
00288 TString filename = fNtpName;
00289 TString tempfilename = ".";
00290 tempfilename += fFileNumber;
00291
00292 if( filename.EndsWith(".root") ){
00293 filename.Insert(filename.Length()-5,tempfilename);
00294 }
00295 else{
00296 filename.Append(tempfilename);
00297 }
00298
00299 MSG("NtpMaker",Msg::kWarning) << " ... CREATING NEW OUTPUT FILE: " << filename.Data() << endl;
00300
00301 // create the new output file
00302 fFile = TFile::Open(filename.Data(), "recreate");
00303 fTree = new TTree("ntp", "FarDet Atmos Events");
00304 fTree->SetDirectory(fFile);
00305 fTree->Branch("evt", "AtmosEvent", &fEvent);
00306 fTree->SetAutoSave(100);
00307 tmpd2->cd();
00308 }
00309
00310 // check that both output file and tree exist
00311 if(!fFile)
00312 {
00313 MSG("NtpMaker",Msg::kError) << " Can't find output file: " << fNtpName.Data() << endl;
00314 MSG("NtpMaker",Msg::kFatal) << " Aaaggghhh... " << endl;
00315 assert(0);
00316 }
00317 if(!fTree)
00318 {
00319 MSG("NtpMaker",Msg::kError) << " Can't find output tree: " << fNtpName.Data() << endl;
00320 MSG("NtpMaker",Msg::kFatal) << " Aaaggghhh... " << endl;
00321 assert(0);
00322 }
00323
00324 // write current event to file
00325 if(fFile)
00326 {
00327 MSG("NtpMaker",Msg::kDebug) << " writing event to file... " << endl;
00328 Int_t filesize(0),filesizeNew(0);
00329
00330 TDirectory* tmpd = gDirectory;
00331 filesize = fFile->GetBytesWritten();
00332 fFile->cd();
00333 fTree->Fill();
00334 filesizeNew = fFile->GetBytesWritten();
00335 gDirectory = tmpd;
00336
00337 MSG("NtpMaker",Msg::kDebug) << " ... bytes written: " << filesizeNew-filesize << endl;
00338 MSG("NtpMaker",Msg::kDebug) << " ... current file size: " << filesizeNew << endl;
00339 }
00340
00341 return result;
00342 }
|
|
|
Implement for notification of begin of job Reimplemented from JobCModule. Definition at line 104 of file NtpMaker.cxx. References MSG. 00105 {
00106 MSG("NtpMaker",Msg::kDebug) << " *** NtpMaker::BeginJob() *** " << endl;
00107
00108 }
|
|
|
Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables. Reimplemented from JobCModule. Definition at line 369 of file NtpMaker.cxx. References fMaxFileSizeBytes, fNtpName, fWriteScintHits, fWriteStdHEPs, fWriteStrips, Registry::Get(), and MSG. 00370 {
00371 MSG("NtpMaker",Msg::kDebug) << " *** NtpMaker::Config(...) *** " << endl;
00372
00373 // Configure the module given the Registry r
00374 Int_t tmpint; const char* tmpchar = 0;
00375 if(r.Get("NtpFileName",tmpchar)) { fNtpName = tmpchar; }
00376 if(r.Get("MaxFileSize",tmpint)) { fMaxFileSizeBytes = 1.0e6*tmpint; }
00377 if(r.Get("WriteStrips",tmpint)) { fWriteStrips = (Bool_t)tmpint; }
00378 if(r.Get("WriteScintHits",tmpint)) { fWriteScintHits = (Bool_t)tmpint; }
00379 if(r.Get("WriteStdHEPs",tmpint)) { fWriteStdHEPs = (Bool_t)tmpint; }
00380 }
|
|
|
Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like: const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; } Reimplemented from JobCModule. Definition at line 346 of file NtpMaker.cxx. References JobCModule::GetName(), Registry::LockKeys(), Registry::LockValues(), MSG, Registry::Set(), Registry::UnLockKeys(), and Registry::UnLockValues(). 00347 {
00348 MSG("NtpMaker",Msg::kDebug) << " *** NtpMaker::DefaultConfig() *** " << endl;
00349
00350 // Supply default configuration for the module
00351 static Registry r;
00352 std::string name = this->GetName();
00353 name += ".config.default";
00354 r.SetName(name.c_str());
00355 r.UnLockKeys();
00356 r.UnLockValues();
00357 r.Set("NtpFileName","ntp.root");
00358 r.Set("MaxFileSize",0);
00359 r.Set("WriteStrips",1);
00360 r.Set("WriteScintHits",1);
00361 r.Set("WriteStdHEPs",1);
00362 r.LockValues();
00363 r.LockKeys();
00364 return r;
00365 }
|
|
|
Implement for notification of end of job Reimplemented from JobCModule. Definition at line 384 of file NtpMaker.cxx. References fEvent, fFile, fNtpName, fTree, and MSG. 00385 {
00386 MSG("NtpMaker",Msg::kDebug) << " *** NtpMaker::EndJob(...) *** " << endl;
00387 if( !fFile )
00388 {
00389 //Create the output file if it doesn't already exist.
00390 MSG("NtpMaker",Msg::kWarning) << " *** NTPMAKER: CREATING EMPTY OUTPUT FILE *** " << endl;
00391 TDirectory *tmpd = gDirectory;
00392 fFile = TFile::Open(fNtpName.Data(), "recreate");
00393 fTree = new TTree("ntp", "FarDet Atmos Events");
00394 fTree->SetDirectory(fFile);
00395 fTree->Branch("evt", "AtmosEvent", &fEvent);
00396 fTree->SetAutoSave(100);
00397 tmpd->cd();
00398 }
00399 // write out file
00400 if( fFile )
00401 {
00402 TDirectory* tmpd = gDirectory;
00403 fFile->cd();
00404 MSG("NtpMaker",Msg::kDebug) << " WRITING FILE: " << fFile->GetBytesWritten() << " bytes (before)" << endl;
00405 fFile->Write();
00406 MSG("NtpMaker",Msg::kDebug) << " WRITING FILE: " << fFile->GetBytesWritten() << " bytes (after)" << endl;
00407 fFile->Close();
00408 gDirectory = tmpd;
00409 }
00410 }
|
|
|
Definition at line 414 of file NtpMaker.cxx. References AtmosCalculator::EventProperties(), fEvent, FillDataQualityInfo(), FillDeMuxInfo(), FillEventInfo(), FillFitTrackInfo(), FillShieldInfo(), FillShowerInfo(), FillSliceInfo(), FillStripInfo(), FillTrackInfo(), CandRecord::GetCandHandleIter(), MSG, AtmosEvent::ShowerList, AtmosCalculator::ShowerProperties(), AtmosEvent::StripList, AtmosEvent::TrackList, and AtmosCalculator::TrackProperties(). Referenced by Ana(). 00415 {
00416 MSG("NtpMaker",Msg::kDebug) << " *** NtpMaker::FillCandInfo(...) *** " << endl;
00417
00418 // Fill information from the candidates
00419 TIter candbit(candrec->GetCandHandleIter());
00420 while(TObject* tob = (TObject*)(candbit()))
00421 {
00422 MSG("NtpMaker",Msg::kDebug) << tob->GetName() << endl;
00423
00424 if(tob->InheritsFrom("CandDataQualityHandle"))
00425 {
00426 FillDataQualityInfo(tob); continue;
00427 }
00428
00429 if(tob->InheritsFrom("CandDeMuxDigitListHandle"))
00430 {
00431 FillDeMuxInfo(tob); continue;
00432 }
00433 if(tob->InheritsFrom("FarDetShieldPlankListHandle"))
00434 {
00435 FillShieldInfo(tob); continue;
00436 }
00437
00438 if(tob->InheritsFrom("FarDetStripListHandle"))
00439 {
00440 FillStripInfo(tob); continue;
00441 }
00442
00443 if(tob->InheritsFrom("FarDetSliceListHandle"))
00444 {
00445 FillSliceInfo(tob); continue;
00446 }
00447
00448 if(tob->InheritsFrom("CandFitTrackListHandle"))
00449 {
00450 FillFitTrackInfo(tob); continue;
00451 }
00452
00453 if(tob->InheritsFrom("CandTrackListHandle"))
00454 {
00455 FillTrackInfo(tob); continue;
00456 }
00457
00458 if(tob->InheritsFrom("CandShowerListHandle"))
00459 {
00460 FillShowerInfo(tob); continue;
00461 }
00462
00463 if(tob->InheritsFrom("FarDetEventListHandle"))
00464 {
00465 FillEventInfo(tob); continue;
00466 }
00467 MSG("NtpMaker",Msg::kDebug) << " NtpMaker has no use for " << tob->GetName() <<endl;
00468 }
00469
00470 // now we've got all the information from the candidates, we can calculate
00471 // the atmospheric neutrino analysis variables using the AtmosCalculator tool
00472
00473 MSG("NtpMaker",Msg::kDebug) << " Running AtmosCalculator..." << endl;
00474 AtmosCalculator AtmosCalc;
00475 TClonesArray& MyFitList = *(fEvent->TrackList);
00476 TClonesArray* MyStrpList = (fEvent->StripList);
00477 TClonesArray& MyShowerList = *(fEvent->ShowerList);
00478
00479 int trklimit = MyFitList.GetLast()+1;
00480 for(int i=0; i<trklimit; ++i)
00481 {
00482 AtmosTrack* MyFit = (AtmosTrack*)(MyFitList[i]);
00483 AtmosCalc.TrackProperties(MyFit,MyStrpList);
00484 }
00485
00486 int shwlimit = MyShowerList.GetLast()+1;
00487 for(int i=0; i<shwlimit; ++i)
00488 {
00489 AtmosShower* MyShower = (AtmosShower*)(MyShowerList[i]);
00490 AtmosCalc.ShowerProperties(MyShower,MyStrpList);
00491 }
00492
00493 AtmosCalc.EventProperties(fEvent,MyStrpList);
00494
00495 MSG("NtpMaker",Msg::kDebug) << " ... AtmosCalculator Finished" << endl;
00496
00497 return;
00498 }
|
|
|
|
|
|
Definition at line 696 of file NtpMaker.cxx. References abs(), AtmosStrip::dS, AtmosTrack::EMcharge, AtmosTrack::EndDirCosU, AtmosTrack::EndDirCosV, AtmosTrack::EndDirCosX, AtmosTrack::EndDirCosY, AtmosTrack::EndDirCosZ, AtmosTrack::EndDirTimeFitNdf, AtmosTrack::EndDirTimeFitRMS, AtmosTrack::EndPlane, AtmosTrack::EndR, AtmosTrack::EndTime, AtmosTrack::EndTrace, AtmosTrack::EndTraceZ, AtmosTrack::EndU, AtmosTrack::EndV, AtmosTrack::EndX, AtmosTrack::EndY, AtmosTrack::EndZ, fEvent, AtmosTrack::FitPass, Calibrator::GetAttenCorrected(), CandFitTrackHandle::GetChi2(), CandHandle::GetDaughterIterator(), CandRecoHandle::GetDirCosU(), CandRecoHandle::GetDirCosV(), CandRecoHandle::GetDirCosZ(), CandTrackHandle::GetdS(), CandFitTrackHandle::GetEMCharge(), CandRecoHandle::GetEndDirCosU(), CandRecoHandle::GetEndDirCosV(), CandRecoHandle::GetEndDirCosZ(), CandRecoHandle::GetEndPlane(), CandRecoHandle::GetEndT(), CandTrackHandle::GetEndTrace(), CandTrackHandle::GetEndTraceZ(), CandRecoHandle::GetEndU(), CandRecoHandle::GetEndV(), CandRecoHandle::GetEndZ(), Calibrator::GetMIP(), CandFitTrackHandle::GetMomentumCurve(), CandFitTrackHandle::GetMomentumRange(), CandHandle::GetNDaughters(), CandFitTrackHandle::GetNDOF(), CandRecoHandle::GetNStrip(), CandTrackHandle::GetNTimeFitDigit(), CandFitTrackHandle::GetPass(), CandStripHandle::GetPlane(), CandFitTrackHandle::GetPlaneQP(), CandTrackHandle::GetRange(), CandStripHandle::GetStrip(), CandTrackHandle::GetTimeBackwardFitNDOF(), CandTrackHandle::GetTimeBackwardFitRMS(), CandTrackHandle::GetTimeFitChi2(), CandTrackHandle::GetTimeForwardFitNDOF(), CandTrackHandle::GetTimeForwardFitRMS(), CandRecoHandle::GetTimeOffset(), CandRecoHandle::GetTimeSlope(), CandTrackHandle::GetU(), CandTrackHandle::GetV(), CandRecoHandle::GetVtxPlane(), CandFitTrackHandle::GetVtxQPError(), CandRecoHandle::GetVtxT(), CandTrackHandle::GetVtxTrace(), CandTrackHandle::GetVtxTraceZ(), CandRecoHandle::GetVtxU(), CandRecoHandle::GetVtxV(), CandRecoHandle::GetVtxZ(), AtmosStrip::GreenFibre, AtmosStrip::HalfLength, AtmosTrack::Index, Calibrator::Instance(), CandTrackHandle::IsTPosValid(), AtmosStrip::L, AtmosStrip::MIP, AtmosTrack::Momentum, AtmosTrack::MomentumCurve, AtmosTrack::MomentumRange, MSG, AtmosEvent::NFits, AtmosTrack::Nplanes, AtmosTrack::Nstrips, AtmosEvent::NStrips, AtmosEvent::NTracks, AtmosStrip::Plane, AtmosTrack::QPvtx, AtmosTrack::QPvtxChi2, AtmosTrack::QPvtxErr, AtmosTrack::QPvtxNdf, AtmosTrack::QPvtxTweaked, AtmosTrack::RangeGCM2, AtmosTrack::RangeMetres, AtmosStrip::Sigcorr, AtmosStrip::Sigmap, AtmosStrip::Strip, AtmosEvent::StripList, AtmosTrack::TimeOffset, AtmosTrack::TimeSlope, AtmosTrack::TimingFitChi2, AtmosTrack::TimingFitNdf, AtmosEvent::TrackList, AtmosStrip::Trk, AtmosStrip::View, AtmosTrack::VtxDirCosU, AtmosTrack::VtxDirCosV, AtmosTrack::VtxDirCosX, AtmosTrack::VtxDirCosY, AtmosTrack::VtxDirCosZ, AtmosTrack::VtxDirTimeFitNdf, AtmosTrack::VtxDirTimeFitRMS, AtmosTrack::VtxPlane, AtmosTrack::VtxR, AtmosTrack::VtxTime, AtmosTrack::VtxTrace, AtmosTrack::VtxTraceZ, AtmosTrack::VtxU, AtmosTrack::VtxV, AtmosTrack::VtxX, AtmosTrack::VtxY, and AtmosTrack::VtxZ. Referenced by FillCandInfo(). 00697 {
00698 CandFitTrackListHandle* FitList = (CandFitTrackListHandle*)(tob);
00699 MSG("NtpMaker",Msg::kDebug) << " ... found CandFitTrackListHandle containing "<<FitList->GetNDaughters()<<" tracks."<< endl;
00700 float nstripcalib(0.0),stripsintrack(0.0);
00701 Calibrator& cal = Calibrator::Instance();
00702
00703 //Reset the track flags
00704 TClonesArray* MyStrpList = (TClonesArray*)(fEvent->StripList);
00705 for(Int_t myint=0;myint<fEvent->NStrips;myint++)
00706 {
00707 AtmosStrip& MyStrp = *((AtmosStrip*)(MyStrpList->At(myint)));
00708 MyStrp.Trk = 0;
00709 MyStrp.dS = -999.9;
00710 }
00711
00712 // Set information from CandFitTrackHandles
00713 // assume same number of CandTracks and CandFitTracks
00714 // (the CandFitTracks entirely overwrite the CandTracks)
00715 TClonesArray* MyFitList = (TClonesArray*)(fEvent->TrackList);
00716 TIter FitItr(FitList->GetDaughterIterator());
00717 fEvent->NFits = 0;
00718 while(CandFitTrackHandle* Fit = (CandFitTrackHandle*)(FitItr()))
00719 {
00720 if( fEvent->NFits < fEvent->NTracks )
00721 {
00722 AtmosTrack* MyFit = (AtmosTrack*)(MyFitList->At(fEvent->NFits++));
00723 MyFit->VtxPlane = Fit->GetVtxPlane();
00724 MyFit->VtxTime = Fit->GetVtxT();
00725 MyFit->VtxU = Fit->GetVtxU();
00726 MyFit->VtxV = Fit->GetVtxV();
00727 MyFit->VtxR = sqrt((MyFit->VtxU*MyFit->VtxU)+(MyFit->VtxV*MyFit->VtxV));
00728 MyFit->VtxX = 0.7071*(Fit->GetVtxU()-Fit->GetVtxV());
00729 MyFit->VtxY = 0.7071*(Fit->GetVtxU()+Fit->GetVtxV());
00730 MyFit->VtxZ = Fit->GetVtxZ();
00731 MyFit->VtxTrace = Fit->GetVtxTrace();
00732 MyFit->VtxTraceZ = Fit->GetVtxTraceZ();
00733 MyFit->VtxDirCosU = Fit->GetDirCosU();
00734 MyFit->VtxDirCosV = Fit->GetDirCosV();
00735 MyFit->VtxDirCosX = 0.7071*(Fit->GetDirCosU()-Fit->GetDirCosV());
00736 MyFit->VtxDirCosY = 0.7071*(Fit->GetDirCosU()+Fit->GetDirCosV());
00737 MyFit->VtxDirCosZ = Fit->GetDirCosZ();
00738 MyFit->EndPlane = Fit->GetEndPlane();
00739 MyFit->EndTime = Fit->GetEndT();
00740 MyFit->EndU = Fit->GetEndU();
00741 MyFit->EndV = Fit->GetEndV();
00742 MyFit->EndR = sqrt((MyFit->EndU*MyFit->EndU)+(MyFit->EndV*MyFit->EndV));
00743 MyFit->EndX = 0.7071*(Fit->GetEndU()-Fit->GetEndV());
00744 MyFit->EndY = 0.7071*(Fit->GetEndU()+Fit->GetEndV());
00745 MyFit->EndZ = Fit->GetEndZ();
00746 MyFit->EndTrace = Fit->GetEndTrace();
00747 MyFit->EndTraceZ = Fit->GetEndTraceZ();
00748 MyFit->EndDirCosU = Fit->GetEndDirCosU();
00749 MyFit->EndDirCosV = Fit->GetEndDirCosV();
00750 MyFit->EndDirCosX = 0.7071*(Fit->GetEndDirCosU()-Fit->GetEndDirCosV());
00751 MyFit->EndDirCosY = 0.7071*(Fit->GetEndDirCosU()+Fit->GetEndDirCosV());
00752 MyFit->EndDirCosZ = Fit->GetEndDirCosZ();
00753 MyFit->RangeGCM2 = Fit->GetRange(Fit->GetVtxPlane());//NB this will lose the extrapolation at vtx and end
00754 MyFit->RangeMetres = Fit->GetdS(Fit->GetVtxPlane());//NB this will lose the extrapolation at vtx and end
00755 MyFit->Nstrips = Fit->GetNStrip(); // AtNu Trk->GetNStrips();
00756 MyFit->Nplanes = abs(MyFit->EndPlane-MyFit->VtxPlane)+1;//Trk->GetNPlane() // AtNu Trk->GetNPlanes();
00757
00758 MyFit->TimingFitChi2 = Fit->GetTimeFitChi2();
00759 MyFit->TimingFitNdf = Fit->GetNTimeFitDigit()-2;
00760 MyFit->TimeSlope = Fit->GetTimeSlope();
00761 MyFit->TimeOffset = Fit->GetTimeOffset();
00762
00763 if(MyFit->EndPlane-MyFit->VtxPlane>0)
00764 {//Forward and Backward variables defined relative to increasing Z
00765 MyFit->VtxDirTimeFitRMS = Fit->GetTimeForwardFitRMS();
00766 MyFit->EndDirTimeFitRMS = Fit->GetTimeBackwardFitRMS();
00767 MyFit->VtxDirTimeFitNdf = Fit->GetTimeForwardFitNDOF();
00768 MyFit->EndDirTimeFitNdf = Fit->GetTimeBackwardFitNDOF();
00769 }
00770 else
00771 {
00772 MyFit->VtxDirTimeFitRMS = Fit->GetTimeBackwardFitRMS();
00773 MyFit->EndDirTimeFitRMS = Fit->GetTimeForwardFitRMS();
00774 MyFit->VtxDirTimeFitNdf = Fit->GetTimeBackwardFitNDOF();
00775 MyFit->EndDirTimeFitNdf = Fit->GetTimeForwardFitNDOF();
00776 }
00777
00778 MyFit->Momentum = Fit->GetMomentumCurve();
00779 MyFit->MomentumRange = Fit->GetMomentumRange();
00780 MyFit->MomentumCurve = Fit->GetMomentumCurve();
00781
00782 MyFit->FitPass = Fit->GetPass();
00783 MyFit->EMcharge = Fit->GetEMCharge();
00784 MyFit->QPvtxChi2 = Fit->GetChi2();
00785 MyFit->QPvtxNdf = Fit->GetNDOF();
00786 MyFit->QPvtx = Fit->GetPlaneQP(MyFit->VtxPlane);
00787 MyFit->QPvtxTweaked = (MyFit->Momentum!=0.0)?MyFit->EMcharge/MyFit->Momentum:0.0;
00788 MyFit->QPvtxErr = Fit->GetVtxQPError();
00789
00790 MyFit->Index = (int)pow(2.,fEvent->NFits-1);
00791
00792 // (don't) reset track strips
00793 //for(Int_t myint=0;myint<fEvent->NStrips;myint++)
00794 // {
00795 // AtmosStrip& MyStrp = *((AtmosStrip*)(MyStrpList->At(myint)));
00796 // MyStrp.Trk = 0;
00797 // }
00798
00799 //set information for strips that are part of this track
00800 nstripcalib=(0.0); stripsintrack = Fit->GetNDaughters();
00801 TIter StrpItr(Fit->GetDaughterIterator());
00802 PlexStripEndId* seidP = 0;
00803 PlexStripEndId* seidN = 0;
00804 while(CandStripHandle* TrkStrp = (CandStripHandle*)(StrpItr()))
00805 {
00806 for(Int_t myint=0;myint<fEvent->NStrips;myint++)
00807 {
00808 AtmosStrip& MyStrp = *((AtmosStrip*)(MyStrpList->At(myint)));
00809
00810 if( TrkStrp->GetPlane()==MyStrp.Plane && TrkStrp->GetStrip()==MyStrp.Strip )
00811 {
00812 if( MyStrp.Trk==0 && Fit->IsTPosValid(MyStrp.Plane) )
00813 { // (using MyStrp.Trk==0 as primary track info should dominate)
00814 if( MyStrp.View==0 )
00815 {
00816 MyStrp.L = Fit->GetV(MyStrp.Plane);
00817 MyStrp.dS = Fit->GetdS(MyStrp.Plane);
00818 MyStrp.GreenFibre[0] = MyStrp.HalfLength - MyStrp.L;
00819 MyStrp.GreenFibre[1] = MyStrp.HalfLength + MyStrp.L;
00820 seidN = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kNegative, StripEnd::kWhole, PlaneView::kU, PlaneCoverage::kTotal);
00821 seidP = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kPositive, StripEnd::kWhole, PlaneView::kU, PlaneCoverage::kTotal);
00822 }
00823 if( MyStrp.View==1 )
00824 {
00825 MyStrp.L = Fit->GetU(MyStrp.Plane);
00826 MyStrp.dS = Fit->GetdS(MyStrp.Plane);
00827 MyStrp.GreenFibre[0] = MyStrp.HalfLength + MyStrp.L;
00828 MyStrp.GreenFibre[1] = MyStrp.HalfLength - MyStrp.L;
00829 seidN = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kNegative, StripEnd::kWhole, PlaneView::kV, PlaneCoverage::kTotal);
00830 seidP = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kPositive, StripEnd::kWhole, PlaneView::kV, PlaneCoverage::kTotal);
00831 }
00832 double lsign = pow(-1.0, (1.0+double(MyStrp.View)) );
00833 if(seidN && MyStrp.Sigcorr[0]>0.0)
00834 {
00835 MyStrp.Sigmap[0] = cal.GetAttenCorrected(MyStrp.Sigcorr[0], lsign*MyStrp.L, *(seidN) );
00836 MyStrp.MIP[0] = cal.GetMIP(MyStrp.Sigmap[0], *(seidN) );
00837 }
00838 if(seidP && MyStrp.Sigcorr[1]>0.0)
00839 {
00840 MyStrp.Sigmap[1] = cal.GetAttenCorrected(MyStrp.Sigcorr[1], lsign*MyStrp.L, *(seidP) );
00841 MyStrp.MIP[1] = cal.GetMIP(MyStrp.Sigmap[1], *(seidP) );
00842 }
00843 if(MyStrp.Sigcorr[0]>0.0 || MyStrp.Sigcorr[1]>0.0) nstripcalib+=1.0;
00844 }
00845 MyStrp.Trk += MyFit->Index;
00846
00847 if(seidP) delete seidP; seidP = 0;
00848 if(seidN) delete seidN; seidN = 0;
00849
00850 break; // break out of loop
00851 // faster - this should be ok as long as the
00852 // same strip doesn't exist twice in a snarl
00853 }
00854 }
00855 }
00856
00857 MSG("NtpMaker",Msg::kVerbose) <<" "<<(int)stripsintrack<<" strips in the fitted track of which "<<(int)nstripcalib<<" were calibrated."<<endl<<flush;
00858 }
00859 }
00860 return;
00861 }
|
|
|
Definition at line 865 of file NtpMaker.cxx. References NEUKIN_DEF::A, AtmosMC::A, abs(), AtmosStdHEP::Child, AtmosScintHit::DE, DigiScintHit::DE(), DigiScintHit::DS(), AtmosScintHit::DS, AtmosStdHEP::E, AtmosMC::Eel, AtmosMC::Ehad, NEUKIN_DEF::EMFrac, AtmosMC::EMfrac, AtmosMC::Emu, AtmosMC::Enu, AtmosMC::Etarg, fEvent, RecDataRecord< T >::GetComponents(), PlexPlaneId::GetPlaneView(), UgliGeomHandle::GetStripHandle(), RecRecordImp< T >::GetVldContext(), NEUKIN_DEF::IAction, NEUKIN_DEF::IBoson, AtmosScintHit::Id, AtmosStdHEP::Id, AtmosMC::IDact, AtmosMC::IDboson, AtmosMC::IDnu, AtmosMC::IDnunoosc, AtmosMC::IDres, AtmosMC::IDtarget, AtmosStdHEP::Index, NEUKIN_DEF::INu, NEUKIN_DEF::INuNoOsc, NEUKIN_DEF::IResonance, NEUKIN_DEF::ITg, UgliStripHandle::LocalToGlobal(), AtmosStdHEP::Mass, AtmosEvent::MCInfo, MSG, AtmosMC::MuEndDistToEdge, AtmosMC::MuEndPlane, AtmosMC::MuEndStrip, AtmosMC::MuEndU, AtmosMC::MuEndV, AtmosMC::MuEndX, AtmosMC::MuEndY, AtmosMC::MuEndZ, AtmosMC::MuPbeg, AtmosMC::MuPend, AtmosMC::MuVtxDistToEdge, AtmosMC::MuVtxPlane, AtmosMC::MuVtxStrip, AtmosMC::MuVtxU, AtmosMC::MuVtxV, AtmosMC::MuVtxX, AtmosMC::MuVtxY, AtmosMC::MuVtxZ, NeuKin, AtmosEvent::NScintHits, AtmosEvent::NStdHEPs, NEUKIN_DEF::P4El1, NEUKIN_DEF::P4Mu1, NEUKIN_DEF::P4Neu, NEUKIN_DEF::P4Shw, NEUKIN_DEF::P4Tgt, AtmosStdHEP::Parent, AtmosScintHit::ParticleE, DigiScintHit::ParticleEnergy(), DigiScintHit::ParticleId(), AtmosMC::PelX, AtmosMC::PelY, AtmosMC::PelZ, AtmosMC::PhadX, AtmosMC::PhadY, AtmosMC::PhadZ, DigiScintHit::Plane(), AtmosScintHit::Plane, AtmosMC::PmuX, AtmosMC::PmuY, AtmosMC::PmuZ, AtmosMC::PnuX, AtmosMC::PnuY, AtmosMC::PnuZ, AtmosMC::PtargX, AtmosMC::PtargY, AtmosMC::PtargZ, AtmosStdHEP::PX, AtmosStdHEP::PY, AtmosStdHEP::PZ, NEUKIN_DEF::Q2, AtmosMC::Q2, AtmosEvent::ScintHitList, NEUKIN_DEF::Sigma, AtmosStdHEP::Status, AtmosEvent::StdHEPList, DigiScintHit::Strip(), AtmosScintHit::Strip, DigiScintHit::StripEndId(), AtmosScintHit::T, DigiScintHit::T1(), DigiScintHit::T2(), DigiScintHit::TrackId(), AtmosScintHit::TrkId, AtmosScintHit::U, AtmosScintHit::V, AtmosScintHit::View, AtmosStdHEP::VtxT, AtmosMC::VtxU, AtmosMC::VtxV, AtmosStdHEP::VtxX, AtmosMC::VtxX, AtmosStdHEP::VtxY, AtmosMC::VtxY, AtmosMC::VtxZ, NEUKIN_DEF::W2, AtmosMC::W2, AtmosScintHit::X, NEUKIN_DEF::X, AtmosMC::x, DigiScintHit::X1(), DigiScintHit::X2(), AtmosMC::Xsection, AtmosScintHit::Y, NEUKIN_DEF::Y, AtmosMC::y, DigiScintHit::Y1(), DigiScintHit::Y2(), AtmosScintHit::Z, NEUKIN_DEF::Z, AtmosMC::Z, DigiScintHit::Z1(), and DigiScintHit::Z2(). Referenced by Ana(). 00866 {
00867 MSG("NtpMaker",Msg::kDebug) << " *** NtpMaker::FillMCInfo(...) *** " << endl;
00868
00869 UgliGeomHandle ugh = (*(simrec->GetVldContext()));
00870 const TObjArray arr(simrec->GetComponents());
00871 TIter iter(arr.MakeIterator());
00872 while(TObject* tob = (TObject*)(iter()))
00873 {
00874 MSG("NtpMaker",Msg::kDebug) << tob->GetName() << endl;
00875
00876 if(tob->GetName()==TString("REROOT_NeuKin"))
00877 {
00878 REROOT_NeuKin* NeuKin = dynamic_cast<REROOT_NeuKin*>(tob);
00879 MSG("NtpMaker",Msg::kDebug) << " ... found REROOT_NeuKin " << endl;
00880 fEvent->MCInfo.IDnu = NeuKin->INu();
00881 fEvent->MCInfo.IDnunoosc = NeuKin->INuNoOsc();
00882 fEvent->MCInfo.IDact = NeuKin->IAction();
00883 fEvent->MCInfo.IDres = NeuKin->IResonance();
00884 fEvent->MCInfo.IDboson = NeuKin->IBoson();
00885 fEvent->MCInfo.IDtarget = NeuKin->ITg();
00886 fEvent->MCInfo.A = NeuKin->A();
00887 fEvent->MCInfo.Z = NeuKin->Z();
00888 fEvent->MCInfo.Xsection = NeuKin->Sigma();
00889 fEvent->MCInfo.EMfrac = NeuKin->EMFrac();
00890 fEvent->MCInfo.W2 = NeuKin->W2();
00891 fEvent->MCInfo.Q2 = NeuKin->Q2();
00892 fEvent->MCInfo.x = NeuKin->X();
00893 fEvent->MCInfo.y = NeuKin->Y();
00894 fEvent->MCInfo.PnuX = NeuKin->P4Neu()[0];
00895 fEvent->MCInfo.PnuY = NeuKin->P4Neu()[1];
00896 fEvent->MCInfo.PnuZ = NeuKin->P4Neu()[2];
00897 fEvent->MCInfo.Enu = NeuKin->P4Neu()[3];
00898 fEvent->MCInfo.PmuX = NeuKin->P4Mu1()[0];
00899 fEvent->MCInfo.PmuY = NeuKin->P4Mu1()[1];
00900 fEvent->MCInfo.PmuZ = NeuKin->P4Mu1()[2];
00901 fEvent->MCInfo.Emu = NeuKin->P4Mu1()[3];
00902 fEvent->MCInfo.PelX = NeuKin->P4El1()[0];
00903 fEvent->MCInfo.PelY = NeuKin->P4El1()[1];
00904 fEvent->MCInfo.PelZ = NeuKin->P4El1()[2];
00905 fEvent->MCInfo.Eel = NeuKin->P4El1()[3];
00906 fEvent->MCInfo.PhadX = NeuKin->P4Shw()[0];
00907 fEvent->MCInfo.PhadY = NeuKin->P4Shw()[1];
00908 fEvent->MCInfo.PhadZ = NeuKin->P4Shw()[2];
00909 fEvent->MCInfo.Ehad = NeuKin->P4Shw()[3];
00910 fEvent->MCInfo.PtargX = NeuKin->P4Tgt()[0];
00911 fEvent->MCInfo.PtargY = NeuKin->P4Tgt()[1];
00912 fEvent->MCInfo.PtargZ = NeuKin->P4Tgt()[2];
00913 fEvent->MCInfo.Etarg = NeuKin->P4Tgt()[3];
00914 }
00915
00916 if(tob->GetName()==TString("StdHep"))
00917 {
00918 TClonesArray* ParticleList = (TClonesArray*)(tob);
00919 MSG("NtpMaker",Msg::kDebug) << " ... found StdHep " << endl;
00920 TClonesArray& MyStdHEPList = *(fEvent->StdHEPList);
00921
00922 TParticle* Particle = dynamic_cast<TParticle*>(ParticleList->At(0));
00923 fEvent->MCInfo.VtxU = 0.7071*(Particle->Vy()+Particle->Vx());
00924 fEvent->MCInfo.VtxV = 0.7071*(Particle->Vy()-Particle->Vx());
00925 fEvent->MCInfo.VtxX = Particle->Vx();
00926 fEvent->MCInfo.VtxY = Particle->Vy();
00927 fEvent->MCInfo.VtxZ = Particle->Vz();
00928 TIter ParticleItr(ParticleList->MakeIterator());
00929 while( const TParticle* StdHEP = dynamic_cast<const TParticle*>(ParticleItr()))
00930 {
00931 AtmosStdHEP* MyStdHEP = new( MyStdHEPList[(fEvent->NStdHEPs)++] ) AtmosStdHEP();
00932 MyStdHEP->Index = fEvent->NStdHEPs - 1;
00933
00934 MyStdHEP->Parent[0] = StdHEP->GetMother(0);
00935 MyStdHEP->Parent[1] = StdHEP->GetMother(1);
00936 MyStdHEP->Child[0] = StdHEP->GetDaughter(0);
00937 MyStdHEP->Child[1] = StdHEP->GetDaughter(1);
00938 MyStdHEP->Id = StdHEP->GetPdgCode();
00939 MyStdHEP->Status = StdHEP->GetStatusCode();
00940 MyStdHEP->Mass = StdHEP->GetCalcMass();
00941 MyStdHEP->PX = StdHEP->Px();
00942 MyStdHEP->PY = StdHEP->Py();
00943 MyStdHEP->PZ = StdHEP->Pz();
00944 MyStdHEP->E = StdHEP->Energy();
00945 MyStdHEP->VtxX = StdHEP->Vx();
00946 MyStdHEP->VtxY = StdHEP->Vy();
00947 MyStdHEP->VtxX = StdHEP->Vz();
00948 MyStdHEP->VtxT = StdHEP->T();
00949 }
00950 }
00951
00952 if(tob->GetName()==TString("DigiScintHits"))
00953 {
00954 TClonesArray* ScintHitList = (TClonesArray*)(tob);
00955 MSG("NtpMaker",Msg::kDebug) << " ... found DigitScintHits " << endl;
00956 TClonesArray& MyScintHitList = *(fEvent->ScintHitList);
00957
00958 Int_t plane,strip;
00959 Int_t idnu,ipdg,trkid;
00960 Double_t u,v,x,y,z,r;
00961 Double_t xm,xp,ym,yp,um,up,vm,vp;
00962 Double_t muvtxU,muvtxV;
00963 Double_t muvtxX,muvtxY,muvtxZ;
00964 Double_t muvtxR,muendR;
00965 Double_t muendU,muendV;
00966 Double_t muendX,muendY,muendZ;
00967 Int_t muvtxpln,muendpln;
00968 Int_t muvtxstrp,muendstrp;
00969 Double_t pmu,maxpmu,minpmu;
00970
00971 muvtxU=0.0; muvtxV=0.0;
00972 muvtxX=0.0; muvtxY=0.0; muvtxZ=0.0;
00973 muendU=0.0; muendV=0.0;
00974 muendX=0.0; muendY=0.0; muendZ=0.0;
00975 muvtxR=999.9; muendR=999.9;
00976 muvtxpln=-999; muendpln=-999;
00977 muvtxstrp=-999; muendstrp=-999;
00978 maxpmu=-999.9; minpmu=-999.9;
00979
00980 PlexStripEndId seid;
00981 UgliStripHandle ush;
00982 TVector3 myglobal;
00983 TIter ScintHitItr(ScintHitList->MakeIterator());
00984 while( const DigiScintHit* ScintHit = dynamic_cast<const DigiScintHit*>(ScintHitItr()))
00985 {
00986 if( ScintHit->DE()<1.0E-4 && abs(ScintHit->ParticleId())!=13 ) continue;
00987 //this is to prevent huge numbers of scinthits being stored in the ntuple
00988
00989 AtmosScintHit* MyScintHit = new( MyScintHitList[(fEvent->NScintHits)++] ) AtmosScintHit();
00990 MyScintHit->Id = ScintHit->ParticleId();
00991 MyScintHit->TrkId = ScintHit->TrackId();
00992 MyScintHit->Plane = ScintHit->Plane();
00993 MyScintHit->Strip = ScintHit->Strip();
00994
00995 seid = ScintHit->StripEndId();
00996 MyScintHit->View = -1;
00997 if(seid.GetPlaneView()==PlaneView::kU) MyScintHit->View = 0;
00998 if(seid.GetPlaneView()==PlaneView::kV) MyScintHit->View = 1;
00999
01000 ush = ugh.GetStripHandle(seid);
01001
01002 TVector3 mylocal( ScintHit->X1(), ScintHit->Y1(), ScintHit->Z1() );
01003 myglobal = ush.LocalToGlobal(mylocal);
01004 //Note: doubles are all being converted to floats here
01005 // SHOULD PROBABLY DO CHECKS HERE TO PREVENT DOUBLES LARGER
01006 // THAN FLT_MAX FROM SCREWING THINGS UP
01007 MyScintHit->U[0] = float(0.7071*(myglobal.Y()+myglobal.X()));
01008 MyScintHit->V[0] = float(0.7071*(myglobal.Y()-myglobal.X()));
01009 MyScintHit->X[0] = float(myglobal.X());
01010 MyScintHit->Y[0] = float(myglobal.Y());
01011 MyScintHit->Z[0] = float(myglobal.Z());
01012 MyScintHit->T[0] = float(ScintHit->T1());
01013
01014 mylocal.SetXYZ( ScintHit->X2(), ScintHit->Y2(), ScintHit->Z2() );
01015 myglobal = ush.LocalToGlobal(mylocal);
01016
01017 MyScintHit->U[1] = float(0.7071*(myglobal.Y()+myglobal.X()));
01018 MyScintHit->V[1] = float(0.7071*(myglobal.Y()-myglobal.X()));
01019 MyScintHit->X[1] = float(myglobal.X());
01020 MyScintHit->Y[1] = float(myglobal.Y());
01021 MyScintHit->Z[1] = float(myglobal.Z());
01022 MyScintHit->T[1] = float(ScintHit->T2());
01023
01024 MyScintHit->DS = float(ScintHit->DS());
01025 MyScintHit->DE = float(ScintHit->DE());
01026 MyScintHit->ParticleE = float(ScintHit->ParticleEnergy());
01027
01028 idnu = fEvent->MCInfo.IDnu;
01029 trkid = ScintHit->TrackId();
01030 ipdg = ScintHit->ParticleId();
01031
01032 if( trkid>=0
01033 && ( (idnu==0 && (ipdg==13 || ipdg==-13) )
01034 || (idnu==14 && ipdg==13) || (idnu==-14 && ipdg==-13) ) )
01035 {
01036 plane = ScintHit->Plane();
01037 strip = ScintHit->Strip();
01038 x = myglobal.X(); y = myglobal.Y(); z = myglobal.Z();
01039 u = 0.7071*(y + x); v = 0.7071*(y - x);
01040 pmu = ScintHit->ParticleEnergy();
01041
01042 r=999.9;
01043 up=4.0-u; if(up<r) r=up;
01044 um=4.0+u; if(um<r) r=um;
01045 vp=4.0-v; if(vp<r) r=vp;
01046 vm=4.0+v; if(vm<r) r=vm;
01047 xp=4.0-x; if(xp<r) r=xp;
01048 xm=4.0+x; if(xm<r) r=xm;
01049 yp=4.0-y; if(yp<r) r=yp;
01050 ym=4.0+y; if(ym<r) r=ym;
01051
01052 if( minpmu<0 || pmu<minpmu )
01053 {
01054 muendU=u; muendV=v;
01055 muendX=x; muendY=y; muendZ=z; muendR=r;
01056 muendstrp=strip; muendpln=plane; minpmu=pmu;
01057 }
01058 if( maxpmu<0 || pmu>maxpmu )
01059 {
01060 muvtxU=u; muvtxV=v;
01061 muvtxX=x; muvtxY=y; muvtxZ=z; muvtxR=r;
01062 muvtxstrp=strip; muvtxpln=plane; maxpmu=pmu;
01063 }
01064 }
01065 }
01066
01067 fEvent->MCInfo.MuVtxU = muvtxU;
01068 fEvent->MCInfo.MuVtxV = muvtxV;
01069 fEvent->MCInfo.MuVtxX = muvtxX;
01070 fEvent->MCInfo.MuVtxY = muvtxY;
01071 fEvent->MCInfo.MuVtxZ = muvtxZ;
01072 fEvent->MCInfo.MuVtxDistToEdge = muvtxR;
01073 fEvent->MCInfo.MuVtxPlane = muvtxpln;
01074 fEvent->MCInfo.MuVtxStrip = muvtxstrp;
01075 fEvent->MCInfo.MuEndU = muendU;
01076 fEvent->MCInfo.MuEndV = muendV;
01077 fEvent->MCInfo.MuEndX = muendX;
01078 fEvent->MCInfo.MuEndY = muendY;
01079 fEvent->MCInfo.MuEndZ = muendZ;
01080 fEvent->MCInfo.MuEndDistToEdge = muendR;
01081 fEvent->MCInfo.MuEndPlane = muendpln;
01082 fEvent->MCInfo.MuEndStrip = muendstrp;
01083 fEvent->MCInfo.MuPbeg = maxpmu;
01084 fEvent->MCInfo.MuPend = minpmu;
01085
01086 }
01087 }
01088
01089 return;
01090 }
|
|
|
Definition at line 1094 of file NtpMaker.cxx. References FillSpillInfo(), RecMinos::GetVldContext(), and MSG. Referenced by Ana(). 01095 {
01096 MSG("NtpMaker",Msg::kDebug) << " *** NtpMaker::FillRawInfo(...) *** " << endl;
01097
01098 const VldContext& vldc = *(rawrec->GetVldContext());
01099 this->FillSpillInfo(vldc);
01100
01101 return;
01102 }
|
|
|
Definition at line 1106 of file NtpMaker.cxx. References AtmosShieldPlank::ClearFibre, fEvent, FarDetShieldPlankHandle::GetCharge(), FarDetShieldPlankHandle::GetClearFibre(), CandHandle::GetDaughterIterator(), FarDetShieldPlankHandle::GetGeomErrors(), FarDetShieldPlankHandle::GetGreenFibre(), CandHandle::GetNDaughters(), FarDetShieldPlankHandle::GetNStrips(), FarDetShieldPlankHandle::GetPlane(), FarDetShieldPlankHandle::GetPlank(), FarDetShieldPlankHandle::GetSection(), FarDetShieldPlankHandle::GetSubSection(), FarDetShieldPlankHandle::GetTime(), FarDetShieldPlankHandle::GetWlsPigtail(), FarDetShieldPlankHandle::GetX(), FarDetShieldPlankHandle::GetY(), FarDetShieldPlankHandle::GetZ(), AtmosShieldPlank::GreenFibre, MSG, AtmosShieldPlank::Ndigits, AtmosShieldPlank::Nerrors, AtmosEvent::NShieldPlanks, AtmosShieldPlank::Nstrips, AtmosShieldPlank::Plane, AtmosShieldPlank::Plank, AtmosShieldPlank::Qadc, AtmosShieldPlank::QPE, AtmosShieldPlank::Section, AtmosEvent::ShieldPlankList, AtmosShieldPlank::SubSection, AtmosShieldPlank::Tcal, AtmosShieldPlank::Traw, AtmosShieldPlank::WlsPigtail, AtmosShieldPlank::X, AtmosShieldPlank::Y, and AtmosShieldPlank::Z. Referenced by FillCandInfo(). 01107 {
01108 FarDetShieldPlankListHandle* ShldList = (FarDetShieldPlankListHandle*)(tob);
01109 MSG("NtpMaker",Msg::kDebug) << " ... found FarDetShieldPlankListHandle " << endl;
01110 TClonesArray& MyShldList = *(fEvent->ShieldPlankList);
01111
01112 TIter ShldItr(ShldList->GetDaughterIterator());
01113 while(FarDetShieldPlankHandle* Shld = (FarDetShieldPlankHandle*)(ShldItr()))
01114 {
01115 AtmosShieldPlank* MyShld = new( MyShldList[(fEvent->NShieldPlanks)++] ) AtmosShieldPlank();
01116
01117 MyShld->Section = Shld->GetSection();
01118 MyShld->SubSection = Shld->GetSubSection();
01119 MyShld->Plane = Shld->GetPlane();
01120 MyShld->Plank = Shld->GetPlank();
01121 MyShld->Nstrips = Shld->GetNStrips();
01122 MyShld->Nerrors = Shld->GetGeomErrors();
01123 MyShld->Ndigits = Shld->GetNDaughters();
01124 MyShld->X = Shld->GetX();
01125 MyShld->Y = Shld->GetY();
01126 MyShld->Z[0] = Shld->GetZ(StripEnd::kNegative);
01127 MyShld->Z[1] = Shld->GetZ(StripEnd::kPositive);
01128 MyShld->Traw[0] = Shld->GetTime(StripEnd::kNegative,CalTimeType::kNone);
01129 MyShld->Traw[1] = Shld->GetTime(StripEnd::kPositive,CalTimeType::kNone);
01130 MyShld->Tcal[0] = Shld->GetTime(StripEnd::kNegative,CalTimeType::kT0);
01131 MyShld->Tcal[1] = Shld->GetTime(StripEnd::kPositive,CalTimeType::kT0);
01132 MyShld->Qadc[0] = Shld->GetCharge(StripEnd::kNegative,CalDigitType::kNone);
01133 MyShld->Qadc[1] = Shld->GetCharge(StripEnd::kPositive,CalDigitType::kNone);
01134 MyShld->QPE[0] = Shld->GetCharge(StripEnd::kNegative,CalDigitType::kPE);
01135 MyShld->QPE[1] = Shld->GetCharge(StripEnd::kPositive,CalDigitType::kPE);
01136 //Do we add info for sigmap and mips?
01137 MyShld->GreenFibre[0] = Shld->GetGreenFibre(StripEnd::kNegative);
01138 MyShld->GreenFibre[1] = Shld->GetGreenFibre(StripEnd::kPositive);
01139 MyShld->WlsPigtail[0] = Shld->GetWlsPigtail(StripEnd::kNegative);
01140 MyShld->WlsPigtail[1] = Shld->GetWlsPigtail(StripEnd::kPositive);
01141 MyShld->ClearFibre[0] = Shld->GetClearFibre(StripEnd::kNegative);
01142 MyShld->ClearFibre[1] = Shld->GetClearFibre(StripEnd::kPositive);
01143
01144 }
01145 return;
01146 }
|
|
|
Definition at line 1150 of file NtpMaker.cxx. References AtmosShower::Energy, fEvent, Calibrator::GetAttenCorrected(), CandHandle::GetDaughterIterator(), CandRecoHandle::GetDirCosU(), CandRecoHandle::GetDirCosV(), CandRecoHandle::GetDirCosZ(), CandShowerHandle::GetEnergy(), Calibrator::GetMIP(), CandHandle::GetNDaughters(), CandRecoHandle::GetNPlane(), CandRecoHandle::GetNStrip(), CandStripHandle::GetPlane(), CandStripHandle::GetStrip(), CandRecoHandle::GetTimeOffset(), CandRecoHandle::GetTimeSlope(), CandShowerHandle::GetU(), CandShowerHandle::GetV(), CandRecoHandle::GetVtxPlane(), CandRecoHandle::GetVtxT(), CandRecoHandle::GetVtxU(), CandRecoHandle::GetVtxV(), CandRecoHandle::GetVtxZ(), AtmosStrip::GreenFibre, AtmosStrip::HalfLength, AtmosShower::Index, Calibrator::Instance(), AtmosStrip::L, AtmosStrip::MIP, MSG, AtmosShower::Nplanes, AtmosEvent::NShowers, AtmosEvent::NStrips, AtmosShower::Nstrips, AtmosStrip::Plane, AtmosEvent::ShowerList, AtmosStrip::Shw, AtmosStrip::Sigcorr, AtmosStrip::Sigmap, AtmosStrip::Strip, AtmosEvent::StripList, AtmosShower::TimeOffset, AtmosShower::TimeSlope, AtmosStrip::Trk, AtmosStrip::View, AtmosShower::VtxDirCosU, AtmosShower::VtxDirCosV, AtmosShower::VtxDirCosX, AtmosShower::VtxDirCosY, AtmosShower::VtxDirCosZ, AtmosShower::VtxPlane, AtmosShower::VtxR, AtmosShower::VtxTime, AtmosShower::VtxU, AtmosShower::VtxV, AtmosShower::VtxX, AtmosShower::VtxY, and AtmosShower::VtxZ. Referenced by FillCandInfo(). 01151 {
01152 CandShowerListHandle* ShwList = (CandShowerListHandle*)(tob);
01153 MSG("NtpMaker",Msg::kDebug) << " ... found CandShowerListHandle containing "<<ShwList->GetNDaughters()<<" showers."<< endl;
01154 float nstripcalib(0.0), nshwstrips(0.0);
01155 Calibrator& cal = Calibrator::Instance();
01156 TClonesArray* MyStrpList = (TClonesArray*)(fEvent->StripList);
01157
01158 // Set information from CandShowerHandle
01159 TClonesArray& MyShwList = *(fEvent->ShowerList);
01160 TIter ShwItr(ShwList->GetDaughterIterator());
01161 while(CandShowerHandle* Shw = (CandShowerHandle*)(ShwItr()))
01162 {
01163 AtmosShower* MyShw = new( MyShwList[(fEvent->NShowers)++] ) AtmosShower();
01164
01165 MyShw->VtxPlane = Shw->GetVtxPlane();
01166 MyShw->VtxTime = Shw->GetVtxT();
01167 MyShw->VtxU = Shw->GetVtxU();
01168 MyShw->VtxV = Shw->GetVtxV();
01169 MyShw->VtxR = sqrt((MyShw->VtxU*MyShw->VtxU)+(MyShw->VtxV*MyShw->VtxV));
01170 MyShw->VtxX = 0.7071*(Shw->GetVtxU()-Shw->GetVtxV());
01171 MyShw->VtxY = 0.7071*(Shw->GetVtxU()+Shw->GetVtxV());
01172 MyShw->VtxZ = Shw->GetVtxZ();
01173
01174 MyShw->VtxDirCosU = Shw->GetDirCosU();
01175 MyShw->VtxDirCosV = Shw->GetDirCosV();
01176 MyShw->VtxDirCosX = 0.7071*(Shw->GetDirCosU()-Shw->GetDirCosV());
01177 MyShw->VtxDirCosY = 0.7071*(Shw->GetDirCosU()+Shw->GetDirCosV());
01178 MyShw->VtxDirCosZ = Shw->GetDirCosZ();
01179 MyShw->TimeSlope = Shw->GetTimeSlope();
01180 MyShw->TimeOffset = Shw->GetTimeOffset();
01181 MyShw->Energy = Shw->GetEnergy();
01182
01183 MyShw->Nstrips = Shw->GetNStrip(); //AtNu Shw->GetNStrips();
01184 MyShw->Nplanes = Shw->GetNPlane(); //AtNu Shw->GetNPlanes();
01185 MyShw->Index = (int)pow(2.,fEvent->NShowers-1);
01186
01187 // Set information for strips that are part of this shower
01188 nshwstrips=Shw->GetNDaughters(); nstripcalib=0.0;
01189 TIter StrpItr(Shw->GetDaughterIterator());
01190 PlexStripEndId* seidP = 0;
01191 PlexStripEndId* seidN = 0;
01192 while(CandStripHandle* ShwStrp = (CandStripHandle*)(StrpItr()))
01193 {
01194 for(Int_t myint=0;myint<fEvent->NStrips;myint++)
01195 {
01196 AtmosStrip& MyStrp = *((AtmosStrip*)(MyStrpList->At(myint)));
01197 if( ShwStrp->GetPlane()==MyStrp.Plane && ShwStrp->GetStrip()==MyStrp.Strip )
01198 {
01199 if( MyStrp.Trk==0 && MyStrp.Shw==0 && Shw->GetU(MyStrp.Plane)>-999.9 && Shw->GetV(MyStrp.Plane)>-999.9 )
01200 {
01201
01202 if( MyStrp.View==0 )
01203 {
01204 MyStrp.L = Shw->GetV(MyStrp.Plane);
01205 MyStrp.GreenFibre[0] = MyStrp.HalfLength - MyStrp.L;
01206 MyStrp.GreenFibre[1] = MyStrp.HalfLength + MyStrp.L;
01207 seidN = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kNegative, StripEnd::kWhole, PlaneView::kU, PlaneCoverage::kTotal);
01208 seidP = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kPositive, StripEnd::kWhole, PlaneView::kU, PlaneCoverage::kTotal);
01209 }
01210 if( MyStrp.View==1 )
01211 {
01212 MyStrp.L = Shw->GetU(MyStrp.Plane);
01213 MyStrp.GreenFibre[0] = MyStrp.HalfLength + MyStrp.L;
01214 MyStrp.GreenFibre[1] = MyStrp.HalfLength - MyStrp.L;
01215 seidN = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kNegative, StripEnd::kWhole, PlaneView::kV, PlaneCoverage::kTotal);
01216 seidP = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kPositive, StripEnd::kWhole, PlaneView::kV, PlaneCoverage::kTotal);
01217 }
01218 double lsign = pow(-1.0, (1.0+double(MyStrp.View)) );
01219 if(seidN && MyStrp.Sigcorr[0]>0.0)
01220 {
01221 MyStrp.Sigmap[0] = cal.GetAttenCorrected(MyStrp.Sigcorr[0], lsign*MyStrp.L, *(seidN) );
01222 MyStrp.MIP[0] = cal.GetMIP(MyStrp.Sigmap[0], *(seidN) );
01223 }
01224 if(seidP && MyStrp.Sigcorr[1]>0.0)
01225 {
01226 MyStrp.Sigmap[1] = cal.GetAttenCorrected(MyStrp.Sigcorr[1], lsign*MyStrp.L, *(seidP) );
01227 MyStrp.MIP[1] = cal.GetMIP(MyStrp.Sigmap[1], *(seidP) );
01228 }
01229 }
01230 if(MyStrp.Sigcorr[0]>0.0 || MyStrp.Sigcorr[1]>0.0) nstripcalib+=1.0;
01231 MyStrp.Shw += MyShw->Index;
01232 }
01233
01234 if(seidP) delete seidP; seidP = 0;
01235 if(seidN) delete seidN; seidN = 0;
01236 }
01237 }
01238 MSG("NtpMaker",Msg::kVerbose) <<" "<<(int)nshwstrips<<" strips in the shower of which "<<(int)nstripcalib<<" were calibrated."<<endl<<flush;
01239 }
01240 return;
01241 }
|
|
|
|
|
Definition at line 1367 of file NtpMaker.cxx. References AtmosStrip::ClearFibre, fEvent, fStrpList, Calibrator::GetAttenCorrected(), FarDetStripHandle::GetCharge(), FarDetStripHandle::GetClearFibre(), CandHandle::GetDaughterIterator(), FarDetStripHandle::GetGreenFibre(), FarDetStripHandle::GetHalfLength(), Calibrator::GetMIP(), CandHandle::GetNDaughters(), FarDetStripHandle::GetPlane(), CandStripHandle::GetPlaneView(), FarDetStripHandle::GetStrip(), FarDetStripHandle::GetTime(), CandStripHandle::GetTPos(), FarDetStripHandle::GetWlsPigtail(), CandStripHandle::GetZPos(), AtmosStrip::GreenFibre, AtmosStrip::HalfLength, Calibrator::Instance(), FarDetStripHandle::IsXtalk(), AtmosStrip::L, AtmosStrip::MIP, MSG, AtmosStrip::Ndigits, AtmosEvent::NStrips, AtmosStrip::Plane, AtmosStrip::Qadc, AtmosStrip::QPE, AtmosStrip::QPEcorr, AtmosStrip::Sigcorr, AtmosStrip::Sigmap, AtmosStrip::Strip, AtmosEvent::StripList, AtmosStrip::T, AtmosStrip::Tcal, AtmosStrip::Traw, AtmosStrip::View, AtmosStrip::WlsPigtail, AtmosStrip::Xtalk, and AtmosStrip::Z. Referenced by FillCandInfo(). 01368 {
01369 FarDetStripListHandle* StrpList = (FarDetStripListHandle*)(tob);
01370 MSG("NtpMaker",Msg::kDebug) << " ... found FarDetStripListHandle " << endl;
01371 TClonesArray& MyStrpList = *(fEvent->StripList);
01372 Calibrator& cal = Calibrator::Instance();
01373 float nstripcalib(0.0);
01374 Int_t pln;
01375 Double_t totq,totqo,opos;
01376
01377 TIter StrpItr(StrpList->GetDaughterIterator());
01378 while(FarDetStripHandle* Strp = dynamic_cast<FarDetStripHandle*>(StrpItr()))
01379 {
01380 AtmosStrip* MyStrp = new( MyStrpList[ (fEvent->NStrips)++] ) AtmosStrip();
01381
01382 MyStrp->Plane = Strp->GetPlane();
01383 MyStrp->Strip = Strp->GetStrip();
01384 if(Strp->GetPlaneView()==PlaneView::kU) MyStrp->View = 0;
01385 if(Strp->GetPlaneView()==PlaneView::kV) MyStrp->View = 1;
01386 MyStrp->L = 0.0;
01387 MyStrp->T = Strp->GetTPos();
01388 MyStrp->Z = Strp->GetZPos();
01389 MyStrp->Ndigits = Strp->GetNDaughters();
01390 MyStrp->Traw[0] = Strp->GetTime(StripEnd::kNegative,CalTimeType::kNone);
01391 MyStrp->Traw[1] = Strp->GetTime(StripEnd::kPositive,CalTimeType::kNone);
01392 MyStrp->Tcal[0] = Strp->GetTime(StripEnd::kNegative,CalTimeType::kT0);
01393 MyStrp->Tcal[1] = Strp->GetTime(StripEnd::kPositive,CalTimeType::kT0);
01394 MyStrp->Qadc[0] = Strp->GetCharge(StripEnd::kNegative,CalDigitType::kNone);
01395 MyStrp->Qadc[1] = Strp->GetCharge(StripEnd::kPositive,CalDigitType::kNone);
01396 MyStrp->QPE[0] = Strp->GetCharge(StripEnd::kNegative,CalDigitType::kPE);
01397 MyStrp->QPE[1] = Strp->GetCharge(StripEnd::kPositive,CalDigitType::kPE);
01398 MyStrp->Sigcorr[0] = Strp->GetCharge(StripEnd::kNegative,CalDigitType::kSigCorr);
01399 MyStrp->Sigcorr[1] = Strp->GetCharge(StripEnd::kPositive,CalDigitType::kSigCorr);
01400 MyStrp->QPEcorr[0] = MyStrp->Sigcorr[0]/65.0; // PEcorr=Sigcorr/<Gain>
01401 MyStrp->QPEcorr[1] = MyStrp->Sigcorr[1]/65.0; // hack the conversion
01402 MyStrp->GreenFibre[0] = Strp->GetGreenFibre(StripEnd::kNegative);
01403 MyStrp->GreenFibre[1] = Strp->GetGreenFibre(StripEnd::kPositive);
01404 MyStrp->WlsPigtail[0] = Strp->GetWlsPigtail(StripEnd::kNegative);
01405 MyStrp->WlsPigtail[1] = Strp->GetWlsPigtail(StripEnd::kPositive);
01406 MyStrp->ClearFibre[0] = Strp->GetClearFibre(StripEnd::kNegative);
01407 MyStrp->ClearFibre[1] = Strp->GetClearFibre(StripEnd::kPositive);
01408 MyStrp->HalfLength = Strp->GetHalfLength();
01409 MyStrp->Xtalk = Strp->IsXtalk(StripEnd::kWhole);
01410
01411 if( MyStrp->Plane>0 && MyStrp->Plane<500 && MyStrp->Xtalk==0 && MyStrp->QPE[0]+MyStrp->QPE[1]>2.0 )
01412 {
01413 fStrpList[MyStrp->Plane].push_back(*MyStrp);
01414 }
01415 }
01416 vector<AtmosStrip>::iterator PlaneStrpIter;
01417 vector<AtmosStrip>::iterator PlaneListEnd;
01418 PlexStripEndId* seidP = 0;
01419 PlexStripEndId* seidN = 0;
01420 for(Int_t myint=0;myint<fEvent->NStrips;myint++)
01421 {
01422 AtmosStrip& MyStrp = *((AtmosStrip*)(MyStrpList.At(myint)));
01423 pln = MyStrp.Plane;
01424
01425 totqo=0.0; totq=0.0; opos=0.0;
01426 if( (pln>1 && pln<249) || (pln>250 && pln<498) )
01427 {
01428 PlaneStrpIter = fStrpList[pln-1].begin();
01429 PlaneListEnd = fStrpList[pln-1].end();
01430 while(PlaneStrpIter!=PlaneListEnd)
01431 {
01432 AtmosStrip& mystrip = *(PlaneStrpIter);
01433 totqo+=(mystrip.QPE[0]+mystrip.QPE[1])*(mystrip.T);
01434 totq+=(mystrip.QPE[0]+mystrip.QPE[1]);
01435 ++PlaneStrpIter;
01436 }
01437 }
01438 if( (pln>0 && pln<248) || (pln>249 && pln<497) )
01439 {
01440 PlaneStrpIter = fStrpList[pln+1].begin();
01441 PlaneListEnd = fStrpList[pln+1].end();
01442 while(PlaneStrpIter!=PlaneListEnd)
01443 {
01444 AtmosStrip& mystrip = *(PlaneStrpIter);
01445 totqo+=(mystrip.QPE[0]+mystrip.QPE[1])*(mystrip.T);
01446 totq+=(mystrip.QPE[0]+mystrip.QPE[1]);
01447 ++PlaneStrpIter;
01448 }
01449 }
01450 if(totq>0.0){ opos=totqo/totq; } else{ opos=0.0; }
01451
01452 MyStrp.L = opos;
01453 if( MyStrp.View==0 )
01454 {
01455 MyStrp.GreenFibre[0] = MyStrp.HalfLength - MyStrp.L;
01456 MyStrp.GreenFibre[1] = MyStrp.HalfLength + MyStrp.L;
01457 seidN = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kNegative, StripEnd::kWhole, PlaneView::kU, PlaneCoverage::kTotal);
01458 seidP = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kPositive, StripEnd::kWhole, PlaneView::kU, PlaneCoverage::kTotal);
01459 }
01460 if( MyStrp.View==1 )
01461 {
01462 seidN = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kNegative, StripEnd::kWhole, PlaneView::kV, PlaneCoverage::kTotal);
01463 seidP = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kPositive, StripEnd::kWhole, PlaneView::kV, PlaneCoverage::kTotal);
01464 MyStrp.GreenFibre[0] = MyStrp.HalfLength + MyStrp.L;
01465 MyStrp.GreenFibre[1] = MyStrp.HalfLength - MyStrp.L;
01466 }
01467
01468 double lsign = pow(-1.0, (1.0+double(MyStrp.View)) );
01469 if(seidN && MyStrp.Sigcorr[0]>0.0)
01470 {
01471 MyStrp.Sigmap[0] = cal.GetAttenCorrected(MyStrp.Sigcorr[0], lsign*opos, *(seidN) );
01472 MyStrp.MIP[0] = cal.GetMIP(MyStrp.Sigmap[0], *(seidN) );
01473 }
01474 if(seidP && MyStrp.Sigcorr[1]>0.0)
01475 {
01476 MyStrp.Sigmap[1] = cal.GetAttenCorrected(MyStrp.Sigcorr[1], lsign*opos, *(seidP) );
01477 MyStrp.MIP[1] = cal.GetMIP(MyStrp.Sigmap[1], *(seidP) );
01478 }
01479 if(MyStrp.Sigcorr[0]>0.0 || MyStrp.Sigcorr[1]>0.0) nstripcalib+=1.0;
01480
01481 if(seidP) delete seidP; seidP = 0;
01482 if(seidN) delete seidN; seidN = 0;
01483 }
01484 MSG("NtpMaker",Msg::kVerbose) <<" "<<(int)(fEvent->NStrips)<<" strips in the event of which "<<(int)nstripcalib<< " were calibrated."<<endl<<flush;
01485
01486 for(Int_t myi=0;myi<500;myi++)
01487 {
01488 fStrpList[myi].clear();
01489 }
01490 return;
01491 }
|
|
|
Definition at line 1495 of file NtpMaker.cxx. References abs(), AtmosTrack::AtNuNplanes, AtmosStrip::dS, AtmosTrack::EndDirCosU, AtmosTrack::EndDirCosV, AtmosTrack::EndDirCosX, AtmosTrack::EndDirCosY, AtmosTrack::EndDirCosZ, AtmosTrack::EndDirTimeFitNdf, AtmosTrack::EndDirTimeFitRMS, AtmosTrack::EndPlane, AtmosTrack::EndR, AtmosTrack::EndTime, AtmosTrack::EndTrace, AtmosTrack::EndTraceZ, AtmosTrack::EndU, AtmosTrack::EndV, AtmosTrack::EndX, AtmosTrack::EndY, AtmosTrack::EndZ, fEvent, Calibrator::GetAttenCorrected(), CandHandle::GetDaughterIterator(), CandRecoHandle::GetDirCosU(), CandRecoHandle::GetDirCosV(), CandRecoHandle::GetDirCosZ(), CandTrackHandle::GetdS(), CandRecoHandle::GetEndDirCosU(), CandRecoHandle::GetEndDirCosV(), CandRecoHandle::GetEndDirCosZ(), CandRecoHandle::GetEndPlane(), CandRecoHandle::GetEndT(), CandTrackHandle::GetEndTrace(), CandTrackHandle::GetEndTraceZ(), CandRecoHandle::GetEndU(), CandRecoHandle::GetEndV(), CandRecoHandle::GetEndZ(), Calibrator::GetMIP(), CandTrackHandle::GetMomentum(), CandHandle::GetNDaughters(), CandRecoHandle::GetNStrip(), CandTrackHandle::GetNTimeFitDigit(), CandStripHandle::GetPlane(), CandTrackHandle::GetRange(), CandStripHandle::GetStrip(), CandTrackHandle::GetTimeBackwardFitNDOF(), CandTrackHandle::GetTimeBackwardFitRMS(), CandTrackHandle::GetTimeFitChi2(), CandTrackHandle::GetTimeForwardFitNDOF(), CandTrackHandle::GetTimeForwardFitRMS(), CandRecoHandle::GetTimeOffset(), CandRecoHandle::GetTimeSlope(), CandTrackHandle::GetU(), CandTrackHandle::GetV(), CandRecoHandle::GetVtxPlane(), CandRecoHandle::GetVtxT(), CandTrackHandle::GetVtxTrace(), CandTrackHandle::GetVtxTraceZ(), CandRecoHandle::GetVtxU(), CandRecoHandle::GetVtxV(), CandRecoHandle::GetVtxZ(), AtmosStrip::GreenFibre, AtmosStrip::HalfLength, AtmosTrack::Index, Calibrator::Instance(), CandTrackHandle::IsTPosValid(), AtmosStrip::L, AtmosStrip::MIP, AtmosTrack::Momentum, AtmosTrack::MomentumRange, MSG, AtmosTrack::Nplanes, AtmosEvent::NStrips, AtmosTrack::Nstrips, AtmosEvent::NTracks, AtmosStrip::Plane, AtmosTrack::RangeGCM2, AtmosTrack::RangeMetres, AtmosStrip::Sigcorr, AtmosStrip::Sigmap, AtmosStrip::Strip, AtmosEvent::StripList, AtmosTrack::TimeOffset, AtmosTrack::TimeSlope, AtmosTrack::TimingFitChi2, AtmosTrack::TimingFitNdf, AtmosEvent::TrackList, AtmosStrip::Trk, AtmosStrip::View, AtmosTrack::VtxDirCosU, AtmosTrack::VtxDirCosV, AtmosTrack::VtxDirCosX, AtmosTrack::VtxDirCosY, AtmosTrack::VtxDirCosZ, AtmosTrack::VtxDirTimeFitNdf, AtmosTrack::VtxDirTimeFitRMS, AtmosTrack::VtxPlane, AtmosTrack::VtxR, AtmosTrack::VtxTime, AtmosTrack::VtxTrace, AtmosTrack::VtxTraceZ, AtmosTrack::VtxU, AtmosTrack::VtxV, AtmosTrack::VtxX, AtmosTrack::VtxY, and AtmosTrack::VtxZ. Referenced by FillCandInfo(). 01496 {
01497 CandTrackListHandle* TrkList = (CandTrackListHandle*)(tob);
01498 MSG("NtpMaker",Msg::kDebug) << " ... found CandTrackListHandle containing "<<TrkList->GetNDaughters()<<" tracks."<< endl;
01499 float nstripcalib(0.0),stripsintrack(0.0);
01500 Calibrator& cal = Calibrator::Instance();
01501 TClonesArray* MyStrpList = (TClonesArray*)(fEvent->StripList);
01502
01503 // Set information from CandTrackHandle
01504 TClonesArray& MyTrkList = *(fEvent->TrackList);
01505 TIter TrkItr = TrkList->GetDaughterIterator();
01506 while(CandTrackHandle* Trk = dynamic_cast<CandTrackHandle*>(TrkItr()))
01507 {
01508 AtmosTrack* MyTrk = new( MyTrkList[(fEvent->NTracks)++] ) AtmosTrack();
01509 MyTrk->VtxPlane = Trk->GetVtxPlane();
01510 MyTrk->VtxTime = Trk->GetVtxT();
01511 MyTrk->VtxU = Trk->GetVtxU();
01512 MyTrk->VtxV = Trk->GetVtxV();
01513 MyTrk->VtxR = sqrt( (MyTrk->VtxU*MyTrk->VtxU) + (MyTrk->VtxV*MyTrk->VtxV) );
01514 MyTrk->VtxX = 0.7071*(Trk->GetVtxU()-Trk->GetVtxV());
01515 MyTrk->VtxY = 0.7071*(Trk->GetVtxU()+Trk->GetVtxV());
01516 MyTrk->VtxZ = Trk->GetVtxZ();
01517 MyTrk->VtxTrace = Trk->GetVtxTrace();
01518 MyTrk->VtxTraceZ = Trk->GetVtxTraceZ();
01519 MyTrk->VtxDirCosU = Trk->GetDirCosU();
01520 MyTrk->VtxDirCosV = Trk->GetDirCosV();
01521 MyTrk->VtxDirCosX = 0.7071*(Trk->GetDirCosU()-Trk->GetDirCosV());
01522 MyTrk->VtxDirCosY = 0.7071*(Trk->GetDirCosU()+Trk->GetDirCosV());
01523 MyTrk->VtxDirCosZ = Trk->GetDirCosZ();
01524 MyTrk->EndPlane = Trk->GetEndPlane();
01525 MyTrk->EndTime = Trk->GetEndT();
01526 MyTrk->EndU = Trk->GetEndU();
01527 MyTrk->EndV = Trk->GetEndV();
01528 MyTrk->EndR = sqrt((MyTrk->EndU*MyTrk->EndU)+(MyTrk->EndV*MyTrk->EndV));
01529 MyTrk->EndX = 0.7071*(Trk->GetEndU()-Trk->GetEndV());
01530 MyTrk->EndY = 0.7071*(Trk->GetEndU()+Trk->GetEndV());
01531 MyTrk->EndZ = Trk->GetEndZ();
01532 MyTrk->EndTrace = Trk->GetEndTrace();
01533 MyTrk->EndTraceZ = Trk->GetEndTraceZ();
01534 MyTrk->EndDirCosU = Trk->GetEndDirCosU();
01535 MyTrk->EndDirCosV = Trk->GetEndDirCosV();
01536 MyTrk->EndDirCosX = 0.7071*(Trk->GetEndDirCosU()-Trk->GetEndDirCosV());
01537 MyTrk->EndDirCosY = 0.7071*(Trk->GetEndDirCosU()+Trk->GetEndDirCosV());
01538 MyTrk->EndDirCosZ = Trk->GetEndDirCosZ();
01539 MyTrk->RangeGCM2 = Trk->GetRange(Trk->GetEndPlane());
01540 // NB this will lose the extrapolation at vtx and end
01541 MyTrk->RangeMetres = Trk->GetdS(Trk->GetEndPlane());
01542 // NB this will lose the extrapolation at vtx and end
01543 MyTrk->Nstrips = Trk->GetNStrip();
01544 MyTrk->Nplanes = abs(MyTrk->EndPlane-MyTrk->VtxPlane)+1;
01545 MyTrk->AtNuNplanes = MyTrk->Nplanes;
01546
01547 MyTrk->TimingFitChi2 = Trk->GetTimeFitChi2();
01548 MyTrk->TimingFitNdf = Trk->GetNTimeFitDigit()-2;
01549 MyTrk->TimeSlope = Trk->GetTimeSlope();
01550 MyTrk->TimeOffset = Trk->GetTimeOffset();
01551
01552 if(MyTrk->EndPlane-MyTrk->VtxPlane>0)
01553 {//Forward and Backward variables defined relative to increasing Z
01554 MyTrk->VtxDirTimeFitRMS = Trk->GetTimeForwardFitRMS();
01555 MyTrk->EndDirTimeFitRMS = Trk->GetTimeBackwardFitRMS();
01556 MyTrk->VtxDirTimeFitNdf = Trk->GetTimeForwardFitNDOF();
01557 MyTrk->EndDirTimeFitNdf = Trk->GetTimeBackwardFitNDOF();
01558 }
01559 else
01560 {
01561 MyTrk->VtxDirTimeFitRMS = Trk->GetTimeBackwardFitRMS();
01562 MyTrk->EndDirTimeFitRMS = Trk->GetTimeForwardFitRMS();
01563 MyTrk->VtxDirTimeFitNdf = Trk->GetTimeBackwardFitNDOF();
01564 MyTrk->EndDirTimeFitNdf = Trk->GetTimeForwardFitNDOF();
01565 }
01566
01567 MyTrk->Momentum = Trk->GetMomentum();
01568 MyTrk->MomentumRange = Trk->GetMomentum();
01569
01570 MyTrk->Index = (int)pow(2.,fEvent->NTracks-1);
01571
01572 //set information for strips that are part of this track
01573 TIter StrpItr(Trk->GetDaughterIterator());
01574 nstripcalib=(0.0); stripsintrack = Trk->GetNDaughters();
01575 PlexStripEndId* seidP = 0;
01576 PlexStripEndId* seidN = 0;
01577 while(CandStripHandle* TrkStrp = (CandStripHandle*)(StrpItr()))
01578 {
01579 for(Int_t myint=0;myint<fEvent->NStrips;myint++)
01580 {
01581 AtmosStrip& MyStrp = *((AtmosStrip*)(MyStrpList->At(myint)));
01582
01583 if( TrkStrp->GetPlane()==MyStrp.Plane && TrkStrp->GetStrip()==MyStrp.Strip )
01584 {
01585 if( MyStrp.Trk==0 && Trk->IsTPosValid(MyStrp.Plane) )
01586 {
01587 if( MyStrp.View==0 )
01588 {
01589 MyStrp.L = Trk->GetV(MyStrp.Plane);
01590 MyStrp.dS = Trk->GetdS(MyStrp.Plane);
01591 MyStrp.GreenFibre[0] = MyStrp.HalfLength - MyStrp.L;
01592 MyStrp.GreenFibre[1] = MyStrp.HalfLength + MyStrp.L;
01593 seidN = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kNegative, StripEnd::kWhole, PlaneView::kU, PlaneCoverage::kTotal);
01594 seidP = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kPositive, StripEnd::kWhole, PlaneView::kU, PlaneCoverage::kTotal);
01595 }
01596 if( MyStrp.View==1 )
01597 {
01598 MyStrp.L = Trk->GetU(MyStrp.Plane);
01599 MyStrp.dS = Trk->GetdS(MyStrp.Plane);
01600 MyStrp.GreenFibre[0] = MyStrp.HalfLength + MyStrp.L;
01601 MyStrp.GreenFibre[1] = MyStrp.HalfLength - MyStrp.L;
01602 seidN = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kNegative, StripEnd::kWhole, PlaneView::kV, PlaneCoverage::kTotal);
01603 seidP = new PlexStripEndId(Detector::kFar, MyStrp.Plane, MyStrp.Strip, StripEnd::kPositive, StripEnd::kWhole, PlaneView::kV, PlaneCoverage::kTotal);
01604 }
01605 double lsign = pow(-1.0, (1.0+double(MyStrp.View)) );
01606 if(seidN && MyStrp.Sigcorr[0]>0.0)
01607 {
01608 MyStrp.Sigmap[0] = cal.GetAttenCorrected(MyStrp.Sigcorr[0], lsign*MyStrp.L, *(seidN) );
01609 MyStrp.MIP[0] = cal.GetMIP(MyStrp.Sigmap[0], *(seidN) );
01610 }
01611 if(seidP && MyStrp.Sigcorr[1]>0.0)
01612 {
01613 MyStrp.Sigmap[1] = cal.GetAttenCorrected(MyStrp.Sigcorr[1], lsign*MyStrp.L, *(seidP) );
01614 MyStrp.MIP[1] = cal.GetMIP(MyStrp.Sigmap[1], *(seidP) );
01615 }
01616 if(MyStrp.Sigcorr[0]>0.0 || MyStrp.Sigcorr[1]>0.0) nstripcalib+=1.0;
01617 }
01618 MyStrp.Trk += MyTrk->Index;
01619
01620 if(seidP) delete seidP; seidP = 0;
01621 if(seidN) delete seidN; seidN = 0;
01622
01623 break; // break out of loop
01624 // faster - this should be ok as long as the
01625 // same strip doesn't exist twice in a snarl
01626 }
01627 }
01628 }
01629 MSG("NtpMaker",Msg::kVerbose) <<" "<<(int)stripsintrack<<" strips in the track of which "<<(int)nstripcalib<< " were calibrated."<<endl<<flush;
01630 }
01631 return;
01632 }
|
|
|
Definition at line 58 of file NtpMaker.h. Referenced by Ana(), EndJob(), FillCandInfo(), FillDataQualityInfo(), FillDeMuxInfo(), FillEventInfo(), FillFitTrackInfo(), FillMCInfo(), FillShieldInfo(), FillShowerInfo(), FillSliceInfo(), FillSpillInfo(), FillStripInfo(), FillTrackInfo(), and NtpMaker(). |
|
|
Definition at line 49 of file NtpMaker.h. Referenced by Ana(), EndJob(), and NtpMaker(). |
|
|
Definition at line 53 of file NtpMaker.h. Referenced by Ana(), and NtpMaker(). |
|
|
Definition at line 52 of file NtpMaker.h. Referenced by Ana(), Config(), and NtpMaker(). |
|
|
Definition at line 51 of file NtpMaker.h. Referenced by Ana(), Config(), EndJob(), and NtpMaker(). |
|
|
Definition at line 59 of file NtpMaker.h. Referenced by FillStripInfo(). |
|
|
Definition at line 50 of file NtpMaker.h. Referenced by Ana(), EndJob(), and NtpMaker(). |
|
|
Definition at line 55 of file NtpMaker.h. Referenced by Config(), and NtpMaker(). |
|
|
Definition at line 56 of file NtpMaker.h. Referenced by Config(), and NtpMaker(). |
|
|
Definition at line 54 of file NtpMaker.h. Referenced by Config(), and NtpMaker(). |
1.3.9.1