17 #ifndef dunezsanalysis_Module 18 #define dunezsanalysis_Module 38 #include "art_root_io/TFileService.h" 40 #include "canvas/Persistency/Common/FindManyP.h" 50 #include "TLorentzVector.h" 111 double fChargeSum[200];
133 dunezsanalysis::~dunezsanalysis()
151 fReconstructionNtuple = tfs->make<TTree>(
"dunezsanalysisReconstruction",
"dunezsanalysisReconstruction");
156 fReconstructionNtuple->Branch(
"Event", &fEvent,
"Event/I");
157 fReconstructionNtuple->Branch(
"Run", &fRun,
"Run/I");
160 fReconstructionNtuple->Branch(
"ChargeSum", fChargeSum,
"ChargeSum[200]/D");
184 fEvent =
event.id().event();
187 auto rawDigitHandle =
event.getHandle< std::vector<raw::RawDigit> >(
"daq");
189 for (
int i=0;i<200;i++)
194 unsigned int nNeighbors = 0;
200 std::vector< art::Ptr<raw::RawDigit> > Digits;
203 for(
size_t d = 0;
d < Digits.size();
d++)
207 uint32_t chan = digit->
Channel();
208 std::vector<short> uncompressed(digit->
Samples());
209 if (fGeometry->View(chan) ==
geo::kZ)
212 for(
unsigned int tick=0;
tick<uncompressed.size();
tick++)
215 unsigned int tlow = (
tick < nNeighbors)? 0:
tick - nNeighbors;
216 unsigned int thigh =
tick + nNeighbors;
217 if (thigh>=uncompressed.size()) thigh = uncompressed.size()-1;
218 for (
short zscut=0;zscut<200;zscut++)
220 if (uncompressed.at(
tick) >= zscut)
222 fChargeSum[zscut] += uncompressed.at(
tick);
226 for (
unsigned int k=tlow;
k<=thigh;
k++)
228 if (uncompressed.at(
k) >= zscut)
230 fChargeSum[zscut] += uncompressed.at(
tick);
241 fReconstructionNtuple->Fill();
251 #endif // dunezsanalysis_Module def analyze(root, level, gtrees, gbranches, doprint)
Store parameters for running LArG4.
const ADCvector_t & ADCs() const
Reference to the compressed ADC count vector.
ULong64_t Samples() const
Number of samples in the uncompressed ADC data.
ChannelID_t Channel() const
DAQ channel this raw data was read from.
Planes which measure Z direction.
art framework interface to geometry description
#define DEFINE_ART_MODULE(klass)
virtual void reconfigure(fhicl::ParameterSet const &pset)
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition of data types for geometry description.
raw::Compress_t Compression() const
Compression algorithm used to store the ADC counts.
std::string fRawProducerLabel
Declaration of signal hit object.
art::ServiceHandle< geo::Geometry > fGeometry
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
TTree * fReconstructionNtuple
Event finding and building.