7 #ifndef PDSPHitMonitor_module 8 #define PDSPHitMonitor_module 15 #include "art_root_io/TFileService.h" 19 #include "canvas/Persistency/Common/FindManyP.h" 173 for(
unsigned int i=0;i<
fNofAPA;i++){
189 fNHitsAPAViewU.push_back(tfs->make<TH1I>(Form(
"NHitsAPA%d_U",j),Form(
"Number of hits APA%d-U",j),1000,0,20000));
190 fNHitsAPAViewV.push_back(tfs->make<TH1I>(Form(
"NHitsAPA%d_V",j),Form(
"Number of hits APA%d-V",j),1000,0,20000));
191 fNHitsAPAViewZ.push_back(tfs->make<TH1I>(Form(
"NHitsAPA%d_Z",j),Form(
"Number of hits APA%d-Z",j),1000,0,20000));
193 fChargeAPAViewU.push_back(tfs->make<TH1F>(Form(
"HitChargeAPA%d_U",j),Form(
"Hit Charge APA%d-U",j),100,0,1500));
194 fChargeAPAViewV.push_back(tfs->make<TH1F>(Form(
"HitChargeAPA%d_V",j),Form(
"Hit Charge APA%d-V",j),100,0,1500));
195 fChargeAPAViewZ.push_back(tfs->make<TH1F>(Form(
"HitChargeAPA%d_Z",j),Form(
"Hit Charge APA%d-Z",j),100,0,1500));
197 fRMSAPAViewU.push_back(tfs->make<TH1F>(Form(
"HitRMSAPA%d_U",j),Form(
"Hit RMS APA%d-U",j),100,0,10));
198 fRMSAPAViewV.push_back(tfs->make<TH1F>(Form(
"HitRMSAPA%d_V",j),Form(
"Hit RMS APA%d-V",j),100,0,10));
199 fRMSAPAViewZ.push_back(tfs->make<TH1F>(Form(
"HitRMSAPA%d_Z",j),Form(
"Hit RMS APA%d-Z",j),100,0,10));
201 fHitPeakTimeAPAViewU.push_back(tfs->make<TH1F>(Form(
"HitPeakTimeAPA%d_U",j),Form(
"Hit Peak Time APA%d-U",j),100,0,10000));
202 fHitPeakTimeAPAViewV.push_back(tfs->make<TH1F>(Form(
"HitPeakTimeAPA%d_V",j),Form(
"Hit Peak Time APA%d-V",j),100,0,10000));
203 fHitPeakTimeAPAViewZ.push_back(tfs->make<TH1F>(Form(
"HitPeakTimeAPA%d_Z",j),Form(
"Hit Peak Time APA%d-Z",j),100,0,10000));
206 fNHitsAPAViewU_prof.push_back(tfs->make<TProfile>(Form(
"fNHitsViewU%d_prof", j),Form(
"Number of hits distribution vs Channel(Plane U, APA%d)", j), UChMax - UChMin + 1, UChMin-0.5, UChMax+0.5,
"s"));
207 fChargeAPAViewU_prof.push_back(tfs->make<TProfile>(Form(
"fChargeViewU%d_prof", j),Form(
"Profiled Hit Charge distribution vs Channel(Plane U, APA%d)", j), UChMax - UChMin + 1, UChMin-0.5, UChMax+0.5,
"s"));
208 fRMSAPAViewU_prof.push_back(tfs->make<TProfile>(Form(
"fRMSViewU%d_prof", j),Form(
"Profiled Hit RMS distribution vs Channel(Plane U, APA%d)", j), UChMax - UChMin + 1, UChMin-0.5, UChMax+0.5,
"s"));
211 fNHitsAPAViewV_prof.push_back(tfs->make<TProfile>(Form(
"fNHitsViewV%d_prof",j),Form(
"Number of hits distribution vs Channel(Plane V, APA%d)",j), VChMax - VChMin + 1, VChMin-0.5, VChMax+0.5,
"s"));
212 fChargeAPAViewV_prof.push_back(tfs->make<TProfile>(Form(
"fChargeViewV%d_prof",j),Form(
"Profiled Hit Charge distribution vs Channel(Plane V, APA%d)",j), VChMax - VChMin + 1, VChMin-0.5, VChMax+0.5,
"s"));
213 fRMSAPAViewV_prof.push_back(tfs->make<TProfile>(Form(
"fRMSViewV%d_prof",j),Form(
"Profiled Hit RMS distribution vs Channel(Plane V, APA%d)",j), VChMax - VChMin + 1, VChMin-0.5, VChMax+0.5,
"s"));
216 fNHitsAPAViewZ_prof.push_back(tfs->make<TProfile>(Form(
"fNHitsViewZ%d_prof",j),Form(
"Number of hits distribution vs Channel(Plane Z, APA%d)",j), ZChMax - ZChMin + 1, ZChMin-0.5, ZChMax+0.5,
"s"));
217 fChargeAPAViewZ_prof.push_back(tfs->make<TProfile>(Form(
"fChargeViewZ%d_prof",j),Form(
"Profiled Hit Charge distribution vs Channel(Plane Z, APA%d)",j), ZChMax - ZChMin + 1, ZChMin-0.5, ZChMax+0.5,
"s"));
218 fRMSAPAViewZ_prof.push_back(tfs->make<TProfile>(Form(
"fRMSViewZ%d_prof",j),Form(
"Profiled Hit RMS distribution vs Channel(Plane Z, APA%d)",j), ZChMax - ZChMin + 1, ZChMin-0.5, ZChMax+0.5,
"s"));
251 fTotalNHits = tfs->make<TH1I>(
"fTotalNHits" ,
"Total number of hits" ,1000,0,1000000);
252 fHitCharge = tfs->make<TH1F>(
"fHitCharge" ,
"Hit Charge" ,100 ,0,1500);
253 fHitRMS = tfs->make<TH1F>(
"fHitChargeRMS" ,
"Hit RMS" ,100 ,0,10);
254 fHitPeakTime = tfs->make<TH1F>(
"fHitPeakTime" ,
"Hit Peak Time" ,100 ,0,10000);
258 fHitCharge->GetXaxis()->SetTitle(
"Charge (ADC units)");
259 fHitRMS->GetXaxis()->SetTitle(
"Hit RMS");
260 fHitPeakTime->GetXaxis()->SetTitle(
"Hit Peak Time");
274 std::vector<art::Ptr<recob::Hit> > hitlist;
277 int NHits = hitlist.size();
280 int NHitsPerApa[10][3];
281 for(
unsigned int j=0; j<10; j++){
282 for(
int k=0;
k<3;
k++){
283 NHitsPerApa[j][
k] = 0;
287 int NHitsChannel[20000];
288 for(
unsigned int j=0; j<20000; j++){
295 for(
int i=0; i<NHits; i++){
298 int hit_channel = hit->
Channel();
310 float hit_rms = hit->
RMS();
319 NHitsPerApa[apa][hit_plane]++;
320 NHitsChannel[hit_channel]++;
330 else if(hit_plane == 1){
338 else if(hit_plane == 2){
349 for(
unsigned int j=0; j<
fNofAPA; j++){
362 for(
unsigned int k=UChMin;
k<UChMax;
k++){
366 for(
unsigned int k=VChMin;
k<VChMax;
k++){
370 for(
unsigned int k=ZChMin;
k<ZChMax;
k++){
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
std::vector< TH1I * > fNHitsAPAViewU
PDSPHitMonitorModule(fhicl::ParameterSet const &pset)
std::vector< TH1F * > fChargeAPAViewV
virtual ~PDSPHitMonitorModule()
std::vector< TH1F * > fChargeAPAViewU
std::vector< TProfile * > fChargeAPAViewZ_prof
std::vector< TProfile * > fNHitsAPAViewV_prof
Handle< PROD > getHandle(SelectorBase const &) const
geo::WireID WireID() const
float RMS() const
RMS of the hit shape, in tick units.
std::vector< TH1F * > fRMSAPAViewU
std::vector< TProfile * > fRMSAPAViewZ_prof
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
void reconfigure(fhicl::ParameterSet const &p)
Planes which measure Z direction.
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
EDAnalyzer(fhicl::ParameterSet const &pset)
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
art framework interface to geometry description
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
std::vector< TProfile * > fNHitsAPAViewZ_prof
std::vector< TProfile * > fNHitsAPAViewU_prof
std::vector< TH1F * > fHitPeakTimeAPAViewZ
#define DEFINE_ART_MODULE(klass)
unsigned int fChansPerAPA
std::vector< TH1I * > fNHitsAPAViewZ
std::vector< TH1F * > fHitPeakTimeAPAViewU
T get(std::string const &key) const
std::vector< TH1I * > fNHitsAPAViewV
std::vector< unsigned int > fApaLabelNum
std::vector< TProfile * > fChargeAPAViewU_prof
std::vector< TProfile * > fChargeAPAViewV_prof
std::vector< TH1F * > fRMSAPAViewZ
PlaneID_t Plane
Index of the plane within its TPC.
Description of geometry of one entire detector.
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
Definition of data types for geometry description.
Detector simulation of raw signals on wires.
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
float PeakTime() const
Time of the signal peak, in tick units.
Declaration of signal hit object.
geo::GeometryCore const * fGeom
std::vector< TH1F * > fChargeAPAViewZ
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void analyze(const art::Event &evt)
std::vector< TH1F * > fRMSAPAViewV
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
TPCID_t TPC
Index of the TPC within its cryostat.
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
std::vector< TProfile * > fRMSAPAViewV_prof
std::vector< TProfile * > fRMSAPAViewU_prof
std::vector< TH1F * > fHitPeakTimeAPAViewV
QTextStream & endl(QTextStream &s)