Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions duneana/AtmoAnalysis/AtmoAnalysis_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "lardataobj/RecoBase/Cluster.h"
#include "lardataobj/RecoBase/Shower.h"
#include "lardataobj/RecoBase/Hit.h"
#include "lardataobj/RecoBase/OpFlash.h"
#include "larcore/Geometry/Geometry.h"
#include "lardata/ArtDataHelper/TrackUtils.h"
#include "lardata/DetectorInfoServices/DetectorClocksService.h"
Expand Down Expand Up @@ -80,6 +81,7 @@ class dune::atmoAnalysis : public art::EDAnalyzer {

TTree *fTree;
TTree *fTreePrimaries;
TTree *fTreePDS;

unsigned int fEventID;
unsigned int fRunID;
Expand Down Expand Up @@ -155,6 +157,18 @@ class dune::atmoAnalysis : public art::EDAnalyzer {
bool fPrimaryContained;
std::string fPrimaryEndProcess;

//Variables for the PDS tree
double fTime;
double fTimeWidth;
int fFrame;
double fTotalPE;
double fXCenter;
double fYCenter;
double fZCenter;
double fXWidth;
double fYWidth;
double fZWidth;

std::string fMCTruthLabel;
std::string fG4Label;
std::string fPandoraNuVertexModuleLabel;
Expand All @@ -173,6 +187,7 @@ class dune::atmoAnalysis : public art::EDAnalyzer {
std::string fSpacePointLabel;
std::string fSpacePointLabelPandora;
std::string fPFPLabel;
std::string fOpFlashLabel;

const geo::Geometry* fGeom;
void clearValues();
Expand Down Expand Up @@ -209,6 +224,7 @@ dune::atmoAnalysis::atmoAnalysis(fhicl::ParameterSet const& p)
fPFPLabel = p.get<std::string>("PFPLabel");
fSpacePointLabel = p.get<std::string>("SpacePointLabel");
fSpacePointLabelPandora = p.get<std::string>("SpacePointLabelPandora");
fOpFlashLabel = p.get<std::string>("OPFlashLabel");
fGeom = &*art::ServiceHandle<geo::Geometry>();
fActiveBounds = getActiveBounds();
}
Expand Down Expand Up @@ -437,6 +453,32 @@ void dune::atmoAnalysis::analyze(art::Event const& evt)

}

//PDS info
art::Handle<std::vector<recob::OpFlash>> opflashHandle = evt.getHandle<std::vector<recob::OpFlash>>(fOpFlashLabel);
if(!opflashHandle.failedToGet()){
for(const recob::OpFlash &flash : *opflashHandle){
fTime = flash.Time();
fTimeWidth = flash.TimeWidth();
fFrame = flash.Frame();
fTotalPE = flash.TotalPE();
if(flash.hasXCenter()){
fXCenter = flash.XCenter();
}
else{
fXCenter = -999;
}
fYCenter = flash.YCenter();
fZCenter = flash.ZCenter();
fXWidth = flash.XWidth();
fYWidth = flash.YWidth();
fZWidth = flash.ZWidth();
fTreePDS->Fill();
}
}
else{
mf::LogWarning("CAFMaker") << "No OpFlash found with label '" << fOpFlashLabel << "'";
}

fTree->Fill();
}

Expand Down Expand Up @@ -673,6 +715,22 @@ void dune::atmoAnalysis::beginJob()
fTreePrimaries->Branch("VisibleE", &fPrimaryVisibleE);
fTreePrimaries->Branch("IsContained", &fPrimaryContained);
fTreePrimaries->Branch("EndProcess", &fPrimaryEndProcess);

fTreePDS = tfs->make<TTree>("pds","PDS Output Tree");
fTreePDS->Branch("eventID",&fEventID,"eventID/i");
fTreePDS->Branch("runID",&fRunID,"runID/i");
fTreePDS->Branch("subrunID",&fSubRunID,"subrunID/i");
fTreePDS->Branch("Time", &fTime);
fTreePDS->Branch("TimeWidth", &fTimeWidth);
fTreePDS->Branch("Frame", &fFrame);
fTreePDS->Branch("TotalPE", &fTotalPE);
fTreePDS->Branch("XCenter", &fXCenter);
fTreePDS->Branch("YCenter", &fYCenter);
fTreePDS->Branch("ZCenter", &fZCenter);
fTreePDS->Branch("XWidth", &fXWidth);
fTreePDS->Branch("YWidth", &fYWidth);
fTreePDS->Branch("ZWidth", &fZWidth);

}
void dune::atmoAnalysis::endJob()
{
Expand Down
1 change: 1 addition & 0 deletions duneana/AtmoAnalysis/atmo_analysis_config.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ atmoAnalysis:
PFPLabel: "pandora"
MCTruthLabel: "generator"
G4Label: "largeant"
OPFlashLabel: "opflash"
}

END_PROLOG