Public Member Functions | Public Attributes | Private Attributes | List of all members
triggersim::ActivityTriggerProd Class Reference
Inheritance diagram for triggersim::ActivityTriggerProd:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 ActivityTriggerProd (fhicl::ParameterSet const &pset)
 
 ActivityTriggerProd (ActivityTriggerProd const &)=delete
 
 ActivityTriggerProd (ActivityTriggerProd &&)=delete
 
ActivityTriggerProdoperator= (ActivityTriggerProd const &)=delete
 
ActivityTriggerProdoperator= (ActivityTriggerProd &&)=delete
 
void produce (art::Event &event) override
 
void reconfigure (fhicl::ParameterSet const &pset)
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Public Attributes

ActivityTrigger TempTrig
 

Private Attributes

art::ServiceHandle< cheat::ParticleInventoryServicepi_serv
 
std::string fAString
 
std::string fRawDigitLabel
 
std::string fOpDetWaveLabel
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 47 of file ActivityTriggerProd_module.cc.

Constructor & Destructor Documentation

triggersim::ActivityTriggerProd::ActivityTriggerProd ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 83 of file ActivityTriggerProd_module.cc.

83  : EDProducer{pset},
84  TempTrig()
85  {
86  // --- Declare what this module is puttting in the art event.
87  produces< std::vector<triggersim::BasicTrigger> >();
88  // --- Configure my trigger module.
89  this->reconfigure(pset);
90  // --- Configure my trigger class.
91  TempTrig.Configure( pset );
92  }
void Configure(fhicl::ParameterSet const &pset)
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
void reconfigure(fhicl::ParameterSet const &pset)
triggersim::ActivityTriggerProd::ActivityTriggerProd ( ActivityTriggerProd const &  )
delete
triggersim::ActivityTriggerProd::ActivityTriggerProd ( ActivityTriggerProd &&  )
delete

Member Function Documentation

ActivityTriggerProd& triggersim::ActivityTriggerProd::operator= ( ActivityTriggerProd const &  )
delete
ActivityTriggerProd& triggersim::ActivityTriggerProd::operator= ( ActivityTriggerProd &&  )
delete
void triggersim::ActivityTriggerProd::produce ( art::Event event)
overridevirtual

Implements art::EDProducer.

Definition at line 114 of file ActivityTriggerProd_module.cc.

115  {
116  // --- Make the vector of BasicTrigger objects:
117  std::unique_ptr< std::vector<triggersim::BasicTrigger> > triggers(new std::vector<triggersim::BasicTrigger>);
118 
119  // --- Lift out the TPC raw digits:
120  auto rawdigits = event.getValidHandle<std::vector<raw::RawDigit> >(fRawDigitLabel);
121  if ( rawdigits.failedToGet() )
122  mf::LogError("ActivityTrigger_Producer") << "The raw::RawDigit you gave me " << fRawDigitLabel << " is not in the event..." << std::endl;
123 
124  // --- Lift out the Photon Detector OpDetWaveforms:
125  auto waveforms = event.getValidHandle<std::vector<raw::OpDetWaveform> >(fOpDetWaveLabel);
126  if ( rawdigits.failedToGet() )
127  mf::LogError("ActivityTrigger_Producer") << "The raw::OpDetWaveform you gave me " << fOpDetWaveLabel << " is not in the event..." << std::endl;
128 
129  // --- Lets get the MCTruth information out of the event using the backtracker we defined earlier...
130  const sim::ParticleList& plist = pi_serv->ParticleList();
131  // --- Now loop through the particle list.
132  for ( sim::ParticleList::const_iterator ipar = plist.begin(); ipar!=plist.end(); ++ipar) {
133  // --- Grab this particle.
134  simb::MCParticle *particle = ipar->second;
135  // Let's just write out what our primary particles are...
136  if (particle->Process() != "primary") continue; // Can also check that particle->Mother() != 0.
137  std::cout << "-- Particle with TrackID " << particle->TrackId() << ", which was a " << particle->PdgCode() << " was a primary and had initial energy " << particle->E()
138  << ", " << particle->NumberTrajectoryPoints() << " trajectory points, and " << particle->NumberDaughters() << " daughters. Process - " << particle->Process()
139  << std::endl;
140  }
141 
142  // **************************************************
143  // *********** Trigger on the whole event ***********
144  // **************************************************
145  std::cout << "\nLet's trigger on the whole event...." << std::endl;
146 
147  // --- Now call the class...
148  bool EvTrigDec = TempTrig.TriggerOnWholeEvent( event );
149 
150  // --- Make my basic trigger and push it back
152  triggers->push_back( my_ev_trig );
153 
154  std::cout << "I have now left my trigger, it's decision was " << EvTrigDec << ".\n" << std::endl;
155 
156  // **************************************************
157  // ************* Trigger on the TPC info ************
158  // **************************************************
159  std::cout << "\nLet's trigger on the TPC info...." << std::endl;
160 
161  // --- Now call the class...
162  bool TPCTrigDec = TempTrig.TriggerOnTPC( *rawdigits );
163 
164  // --- Make my basic trigger and push it back
166  triggers->push_back( my_tpc_trig );
167 
168  std::cout << "I have now left my trigger, it's decision was " << TPCTrigDec << ".\n" << std::endl;
169 
170  // **************************************************
171  // ******** Trigger on the OpDetWaveform info *******
172  // **************************************************
173  std::cout << "\nLet's trigger on the OpDetWaveform info...." << std::endl;
174 
175  // --- Now call the class...
176  bool PDTrigDec = TempTrig.TriggerOnPD( *waveforms );
177 
178  // --- Make my basic trigger and push it back
180  triggers->push_back( my_pd_trig );
181 
182  std::cout << "I have now left my trigger, it's decision was " << PDTrigDec << ".\n" << std::endl;
183 
184 
185  // **************************************************
186  // *** Trigger on the OpDetWaveform and TPC info ****
187  // **************************************************
188  std::cout << "\nLet's trigger on the TPC and OpDetWaveform info...." << std::endl;
189 
190  // --- Now call the class...
191  bool TPC_PD_TrigDec = TempTrig.TriggerOnTPC_PD( *rawdigits, *waveforms );
192 
193  // --- Make my basic trigger and push it back
194  triggersim::BasicTrigger my_tpc_pd_trig( TPC_PD_TrigDec , triggersim::kNu, triggersim::kNuBeam);
195  triggers->push_back( my_tpc_pd_trig );
196 
197  std::cout << "I have now left my trigger, it's decision was " << TPC_PD_TrigDec << ".\n" << std::endl;
198 
199 
200  // **************************************************
201  // **** Trigger some of the triggers we've made *****
202  // **************************************************
203  std::cout << "\nLet's trigger on the triggers I've just made...." << std::endl;
204 
205  // --- Now call the class...
206  bool Trig_TrigDec = TempTrig.TriggerOnTriggers( *triggers );
207 
208  // --- Make my basic trigger and push it back
209  triggersim::BasicTrigger my_trig_trig( Trig_TrigDec , triggersim::kNu, triggersim::kNuBeam);
210  triggers->push_back( my_trig_trig );
211 
212  std::cout << "I have now left my trigger, it's decision was " << Trig_TrigDec << ".\n" << std::endl;
213 
214  // **************************************************
215  // ******* Now put all of that into the event *******
216  // **************************************************
217  event.put(std::move(triggers));
218 
219  } // ActivityTriggerProd::produce()
double E(const int i=0) const
Definition: MCParticle.h:233
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:218
int PdgCode() const
Definition: MCParticle.h:212
bool TriggerOnTPC(std::vector< raw::RawDigit > rawTPC)
intermediate_table::const_iterator const_iterator
const unsigned int kNu
Definition: TriggerTypes.h:17
std::string Process() const
Definition: MCParticle.h:215
int NumberDaughters() const
Definition: MCParticle.h:217
int TrackId() const
Definition: MCParticle.h:210
def move(depos, offset)
Definition: depos.py:107
bool TriggerOnPD(std::vector< raw::OpDetWaveform > rawPD)
bool TriggerOnTPC_PD(std::vector< raw::RawDigit > rawTPC, std::vector< raw::OpDetWaveform > rawPD)
const sim::ParticleList & ParticleList() const
bool TriggerOnWholeEvent(art::Event &event)
bool TriggerOnTriggers(std::vector< triggersim::BasicTrigger > triggerVec)
QTextStream & endl(QTextStream &s)
const unsigned int kNuBeam
Definition: TriggerTypes.h:45
art::ServiceHandle< cheat::ParticleInventoryService > pi_serv
void triggersim::ActivityTriggerProd::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 97 of file ActivityTriggerProd_module.cc.

98  {
99  // --- Pull the variables from the fcl file.
100  fAString = pset.get<std::string> ("AString");
101  fRawDigitLabel = pset.get<std::string> ("RawDigitLabel");
102  fOpDetWaveLabel = pset.get<std::string> ("OpDetWaveLabel");
103 
104  // To convince ourselves that they have been set, print them out...
105  std::cout << "\n------In my Activity Trigger module------\nThe fcl params have been set to :"
106  << "\n fAString: " << fAString
107  << "\n fRawDigitLabel: " << fRawDigitLabel
108  << "\n fOpDetWaveLabel: " << fOpDetWaveLabel
109  << "\n-------------------------------\n"
110  << std::endl;
111  }
std::string string
Definition: nybbler.cc:12
QTextStream & endl(QTextStream &s)

Member Data Documentation

std::string triggersim::ActivityTriggerProd::fAString
private

Definition at line 76 of file ActivityTriggerProd_module.cc.

std::string triggersim::ActivityTriggerProd::fOpDetWaveLabel
private

Definition at line 78 of file ActivityTriggerProd_module.cc.

std::string triggersim::ActivityTriggerProd::fRawDigitLabel
private

Definition at line 77 of file ActivityTriggerProd_module.cc.

art::ServiceHandle<cheat::ParticleInventoryService> triggersim::ActivityTriggerProd::pi_serv
private

Definition at line 73 of file ActivityTriggerProd_module.cc.

ActivityTrigger triggersim::ActivityTriggerProd::TempTrig

Definition at line 68 of file ActivityTriggerProd_module.cc.


The documentation for this class was generated from the following file: