20 #include "art_root_io/TFileService.h" 21 #include "art_root_io/TFileDirectory.h" 31 #include <TGeoVolume.h> 42 class MakeInfillTrainingData;
93 std::map<readout::ROPID, TH2F*> ropImages;
97 if (detProp.NumberTimeSamples() != 6000) {
98 std::cerr <<
"MakeInfillTrainingData_module.cc: Training data should have 6000 time ticks\n";
107 ropImages[rop] =
tfs->make<TH2F>(
117 if(ropImages.count(rop)){
124 const int adc = adcs[
tick] ?
int(adcs[
tick]) - dig.GetPedestal() : 0;
126 ropImages[rop]->Fill(dig.Channel() - firstCh,
tick,
adc);
133 for(
auto it: ropImages)
delete it.second;
143 for (iRop = rBegin; iRop != rEnd; ++iRop) {
148 if (tpcVol->Capacity() > 1000000) {
151 std::cerr <<
"MakeInfillTrainingData_module.cc: Induction view training data should have 800 channels\n";
155 std::cerr <<
"MakeInfillTrainingData_module.cc: Collection view training data should have 480 channels\n";
168 std::cout <<
"Getting dead channels..." <<
std::endl;
180 std::cout <<
"(TPCset " << rop.TPCset <<
", ROP " << rop.ROP <<
"): ";
184 std::cout << ch - firstCh <<
" ";
std::vector< geo::TPCID > ROPtoTPCs(readout::ROPID const &ropid) const
Returns a list of ID of TPCs the specified ROP spans.
std::set< raw::ChannelID_t > fNoisyChannels
Collection of charge vs time digitized from a single readout channel.
std::set< readout::ROPID > fActiveRops
static constexpr BeginPos_t begin_pos
Handle< PROD > getHandle(SelectorBase const &) const
Base forward iterator browsing all readout plane IDs in the detector.
const geo::GeometryCore * fGeom
Geometry information for a single TPC.
art::ServiceHandle< art::TFileService > tfs
static constexpr EndPos_t end_pos
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
virtual const provider_type * provider() const override
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
EDAnalyzer(fhicl::ParameterSet const &pset)
art framework interface to geometry description
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
MakeInfillTrainingData(fhicl::ParameterSet const &p)
#define DEFINE_ART_MODULE(klass)
Signal from induction planes.
raw::ChannelID_t FirstChannelInROP(readout::ROPID const &ropid) const
Returns the ID of the first channel in the specified readout plane.
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
const TGeoVolume * ActiveVolume() const
The data type to uniquely identify a TPC.
Description of geometry of one entire detector.
Class identifying a set of planes sharing readout channels.
std::set< raw::ChannelID_t > fBadChannels
std::set< raw::ChannelID_t > fDeadChannels
readout::ROPID ChannelToROP(raw::ChannelID_t channel) const
void analyze(art::Event const &e) override
EventNumber_t event() const
Access the description of detector geometry.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Interface for experiment-specific service for channel quality info.
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
std::string to_string(ModuleType const mt)
MakeInfillTrainingData & operator=(MakeInfillTrainingData const &)=delete
SubRunNumber_t subRun() const
QTextStream & endl(QTextStream &s)
Signal from collection planes.