120 loginfo <<
"====================================" <<
"\n" 121 <<
"Making Histograms" <<
"\n" 122 <<
"====================================" <<
"\n";
126 auto const* detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
128 const double samplingRate = detprop->SamplingRate();
129 const unsinged
int millisliceSize = 5e6;
130 const unsigned int maxNumTicksPerEvent = millisliceSize / samplingRate;
142 loginfo <<
"Making Number of Hits per TPC Histograms\n";
145 std::ostringstream histName;
146 histName <<
"hist_num_hits_tpc_" << tpc;
148 std::ostringstream histTitle;
149 histTitle <<
"Number of hits per event TPC " << tpc <<
";Log_{10}(Number of hits);Number of events";
151 const unsigned int numPlanes = geom->
Nplanes(tpc);
152 unsigned int totalNumWires = 0;
153 for(
unsigned int plane=0;plane<numPlanes;plane++){
154 unsigned int numWires = geom->
Nwires(plane, tpc);
155 totalNumWires += numWires;
158 unsigned int maxNumHits = totalNumWires * maxNumTicksPerEvent;
162 int binHigh = TMath::Log10(maxNumHits);
163 TH1I* tempHist = tfs->make<TH1I>(histName.str().c_str(), histTitle.str().c_str(), numBins, binLow, binHigh);
165 loginfo <<
"histName: " << histName.str() <<
"\n";
169 <<
"Making Number of ticks / wire / event / TPC Histograms\n";
171 for(
size_t tpc = 0; tpc < fHistNumTicksPerEvent.size(); tpc++){
172 std::ostringstream histName;
173 histName <<
"hist_num_ticks_per_event_tpc_" << tpc;
175 std::ostringstream histTitle;
176 histTitle <<
"Number of ticks / wire / event in TPC " << tpc <<
";Number of ticks;Number of events";
180 int binHigh = maxNumTicksPerEvent;
181 TH1I* tempHist = tfs->make<TH1I>(histName.str().c_str(), histTitle.str().c_str(), numBins, binLow, binHigh);
182 fHistNumTicksPerEvent.at(tpc) = tempHist;
183 loginfo <<
"histName: " << histName.str() <<
"\n";
187 <<
"Making Number of ticks / wire / event pair / TPC Histograms\n";
189 for(
size_t tpc = 0; tpc < fHistNumTicksPerEventPair.size(); tpc++){
190 std::ostringstream histName;
191 histName <<
"hist_num_ticks_per_event_pair_tpc_" << tpc;
193 std::ostringstream histTitle;
194 histTitle <<
"Number of ticks / wire / event pair in TPC " << tpc <<
";Number of ticks;Number of event pairs";
198 int binHigh = maxNumTicksPerEvent;
199 TH1I* tempHist = tfs->make<TH1I>(histName.str().c_str(), histTitle.str().c_str(), numBins, binLow, binHigh);
200 fHistNumTicksPerEventPair.at(tpc) = tempHist;
201 loginfo <<
"histName: " << histName.str() <<
"\n";
205 <<
"Making Number of ticks / wire / event vs last / TPC Histograms\n";
207 for(
size_t tpc = 0; tpc < fHistNumTicksPerEventVsLast.size(); tpc++){
208 std::ostringstream histName;
209 histName <<
"hist_num_ticks_per_event_vs_last_tpc_" << tpc;
211 std::ostringstream histTitle;
212 histTitle <<
"Number of ticks / wire / event vs last event in TPC " << tpc <<
";Number of ticks;Number of ticks (last)";
216 int binHigh = maxNumTicksPerEvent;
217 TH2I* tempHist = tfs->make<TH2I>(histName.str().c_str(), histTitle.str().c_str(), numBins, binLow, binHigh, numBins, binLow, binHigh);
218 fHistNumTicksPerEventVsLast.at(tpc) = tempHist;
219 loginfo <<
"histName: " << histName.str() <<
"\n";
222 loginfo <<
"====================================" <<
"\n" 223 <<
"Finished Making Histograms" <<
"\n" 224 <<
"====================================" <<
"\n";
std::vector< TH1I * > fHistNumTicksPerEventPair
std::vector< TH2I * > fHistNumTicksPerEventVsLast
std::vector< TH1I * > fHistNumHitsPerTPC
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
std::vector< TH1I * > fHistNumTicksPerEvent
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.