Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ class LightPropagationCorrectionAna : public art::EDAnalyzer {
TTree* fTree; ///< The TTree for storing event information

double fOpFlashT0;
double fUpstreamTime_lightonly;
double fUpstreamTime_tpczcorr;
double fUpstreamTime_propcorr_tpczcorr;
double fNuToFLight;
double fNuToFCharge;
double fOpFlashT0Corrected;

unsigned int _eventID;
unsigned int _runID;
Expand All @@ -73,9 +73,9 @@ LightPropagationCorrectionAna::LightPropagationCorrectionAna(fhicl::ParameterSet
void LightPropagationCorrectionAna::analyze(art::Event const& e)
{
fOpFlashT0=-99999.;
fUpstreamTime_lightonly=-99999.;
fUpstreamTime_tpczcorr=-99999.;
fUpstreamTime_propcorr_tpczcorr=-99999.;
fNuToFLight=-99999.;
fNuToFCharge=-99999.;
fOpFlashT0Corrected=-99999.;

_eventID = -1;
_runID = -1;
Expand Down Expand Up @@ -118,14 +118,14 @@ void LightPropagationCorrectionAna::analyze(art::Event const& e)

std::cout << " Corrected flash time is " << correctedopflash->OpFlashT0 << std::endl;
std::cout << " Associated with slice id " << slice_v[0]->ID() << std::endl;
std::cout << "Corrected flash time light only " << correctedopflash->UpstreamTime_lightonly << std::endl;
std::cout << "Corrected flash time tpc z corr " << correctedopflash->UpstreamTime_tpczcorr << std::endl;
std::cout << "Corrected flash time prop corr tpc z corr " << correctedopflash->UpstreamTime_propcorr_tpczcorr << std::endl;
std::cout << "Corrected flash time light only " << correctedopflash->NuToFLight << std::endl;
std::cout << "Corrected flash time tpc z corr " << correctedopflash->NuToFCharge << std::endl;
std::cout << "Corrected flash time prop corr tpc z corr " << correctedopflash->OpFlashT0Corrected << std::endl;

fOpFlashT0 = correctedopflash->OpFlashT0;
fUpstreamTime_lightonly = correctedopflash->UpstreamTime_lightonly;
fUpstreamTime_tpczcorr = correctedopflash->UpstreamTime_tpczcorr;
fUpstreamTime_propcorr_tpczcorr = correctedopflash->UpstreamTime_propcorr_tpczcorr;
fNuToFLight = correctedopflash->NuToFLight;
fNuToFCharge = correctedopflash->NuToFCharge;
fOpFlashT0Corrected = correctedopflash->OpFlashT0Corrected;
fTree->Fill();
}
}
Expand All @@ -141,9 +141,9 @@ void LightPropagationCorrectionAna::beginJob()
fTree->Branch("subrunID", &_subrunID, "subrunID/i");

fTree->Branch("fOpFlashT0", &fOpFlashT0, "OpFlashT0/d");
fTree->Branch("fUpstreamTime_lightonly", &fUpstreamTime_lightonly, "UpstreamTime_lightonly/d");
fTree->Branch("fUpstreamTime_tpczcorr", &fUpstreamTime_tpczcorr, "UpstreamTime_tpczcorr/d");
fTree->Branch("fUpstreamTime_propcorr_tpczcorr", &fUpstreamTime_propcorr_tpczcorr, "UpstreamTime_propcorr_tpczcorr/d");
fTree->Branch("fNuToFLight", &fNuToFLight, "NuToFLight/d");
fTree->Branch("fNuToFCharge", &fNuToFCharge, "NuToFCharge/d");
fTree->Branch("fOpFlashT0Corrected", &fOpFlashT0Corrected, "OpFlashT0Corrected/d");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ void sbnd::LightPropagationCorrection::produce(art::Event & e)
fEvent = e.id().event();
fRun = e.id().run();
fSubrun = e.id().subRun();
_flashgeo->InitializeFlashGeoAlgo();

std::unique_ptr< std::vector<sbn::CorrectedOpFlashTiming> > correctedOpFlashTimes (new std::vector<sbn::CorrectedOpFlashTiming>);
art::PtrMaker<sbn::CorrectedOpFlashTiming> make_correctedopflashtime_ptr{e};
Expand Down Expand Up @@ -128,9 +129,6 @@ void sbnd::LightPropagationCorrection::produce(art::Event & e)
ResetSliceInfo();
// --- Get the slice
auto & slice = sliceVect[ix];

// --- Get the slice nu score and check whether we want to correct for it

// Now I need to get all the hits associated to this flash and get the timing for all of them
// Get the slices PFPs
double _sliceMaxNuScore = -9999.;
Expand All @@ -150,11 +148,7 @@ void sbnd::LightPropagationCorrection::produce(art::Event & e)
fRecoVx= xyz_vertex.X();
fRecoVy= xyz_vertex.Y();
fRecoVz= xyz_vertex.Z();
}
// If correct light propagation time


// Get the SP associated to the PFP and then get the hits associated to the SP. ---> Hits associated to the PFP
}
//Get the spacepoints associated to the PFParticle
std::vector<art::Ptr<recob::SpacePoint>> PFPSpacePointsVect = pfp_sp_assns.at(pfp.key());
//Get the SP Hit assns
Expand All @@ -170,7 +164,6 @@ void sbnd::LightPropagationCorrection::produce(art::Event & e)
fSpacePointY.push_back(SP->position().Y());
fSpacePointZ.push_back(SP->position().Z());
fSpacePointIntegral.push_back(SPHit.at(0)->Integral());

//Fill Bayrcenter Position
if(SP->position().X() < 0){
fChargeWeightX[0] += SP->position().X() * SPHit.at(0)->Integral();
Expand Down Expand Up @@ -299,11 +292,9 @@ void sbnd::LightPropagationCorrection::produce(art::Event & e)
newFlashTime = flasht0;
sbn::CorrectedOpFlashTiming correctedOpFlashTiming;
correctedOpFlashTiming.OpFlashT0 = originalFlashTime + fEventTriggerTime/1000 - fRWMTime/1000;
correctedOpFlashTiming.UpstreamTime_lightonly = originalFlashTime + fEventTriggerTime/1000 - fRWMTime/1000 - (Zcenter/fSpeedOfLight)/1000;
correctedOpFlashTiming.UpstreamTime_tpczcorr = originalFlashTime + fEventTriggerTime/1000 - fRWMTime/1000 - (fRecoVz/fSpeedOfLight)/1000;
correctedOpFlashTiming.UpstreamTime_propcorr_tpczcorr = newFlashTime + fEventTriggerTime/1000 - fRWMTime/1000 - (fRecoVz/fSpeedOfLight)/1000;
correctedOpFlashTiming.FMScore = _fFMScore;
correctedOpFlashTiming.SliceNuScore = _sliceMaxNuScore;
correctedOpFlashTiming.NuToFLight = (Zcenter/fSpeedOfLight)/1000;
correctedOpFlashTiming.NuToFCharge = (fRecoVz/fSpeedOfLight)/1000;
correctedOpFlashTiming.OpFlashT0Corrected = newFlashTime + fEventTriggerTime/1000 - fRWMTime/1000;
correctedOpFlashTimes->emplace_back(std::move(correctedOpFlashTiming));
}

Expand Down