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