Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
sn::SNMichelAnalyzer Class Reference
Inheritance diagram for sn::SNMichelAnalyzer:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 SNMichelAnalyzer (fhicl::ParameterSet const &p)
 
 SNMichelAnalyzer (SNMichelAnalyzer const &)=delete
 
 SNMichelAnalyzer (SNMichelAnalyzer &&)=delete
 
SNMichelAnalyzeroperator= (SNMichelAnalyzer const &)=delete
 
SNMichelAnalyzeroperator= (SNMichelAnalyzer &&)=delete
 
void beginJob ()
 
void analyze (art::Event const &e) override
 
void ClusterAroundTrackEnds (std::vector< std::pair< int, std::pair< double, TVector3 >>> trackEnds, art::Event const &e, TTree *&tree, bool kIsBackground=false)
 
double DistanceHitToPoint (const rb::CellHit hit, const TVector3 point)
 
bool PointIsContained (TVector3 point)
 
sn::TrackType GetTrackType (rb::Track track)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

std::string fRawDataLabel
 ART module label for raw data. More...
 
std::string fCellHitLabel
 ART module label for cell hits. More...
 
std::string fClusterLabel
 ART module label for clusters. More...
 
std::string fTrackLabel
 ART module label for tracks. More...
 
bool fBackgroundSampleEnable
 Switch to enable collecting a background sample. More...
 
int fBackgroundSampleDepth
 Number of events to look back for background sample. More...
 
int fMuonEndSphereRadius
 Distance from end of muon track to veto. More...
 
int fMuonEndTimeCut
 Time from end of muon track to veto. More...
 
int fEvt
 Event number. More...
 
int fRun
 Run number. More...
 
int fSubrun
 Subrun number. More...
 
int fMichelSumADC
 Total Michel cluster ADC. More...
 
float fMichelSumGeV
 Total Michel cluster GeV. More...
 
float fMichelMeanTNS
 Mean Michel cluster time (ns) More...
 
int fMichelNHits
 Number of hits in Michel cluster. More...
 
int fMichelTrackId
 Identifier for stopping tracks. More...
 
float fMichelDistance
 Distance from Michel cluster to track. More...
 
float fMichelTimeDiff
 Time diff from Michel cluster to track. More...
 
int fTrigNMicroslices
 Number of microslices in trigger. More...
 
unsigned long long fTrigUnixTimeStart
 Unix time of trigger (in ns) More...
 
uint32_t fTrigLength
 Duration of trigger (in ns) More...
 
TTree * fTreeMichels
 
TTree * fTreeBackground
 
art::ServiceHandle< geo::GeometryfGeom
 
sn::MichelBackgroundManagerfBkgManager
 

Detailed Description

Definition at line 110 of file SNMichelAnalyzer_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

sn::SNMichelAnalyzer::SNMichelAnalyzer ( fhicl::ParameterSet const &  p)
explicit

Definition at line 163 of file SNMichelAnalyzer_module.cc.

References fBackgroundSampleDepth, and fBkgManager.

163  :
164 EDAnalyzer(p),
165 fRawDataLabel(p.get<std::string>("RawDataLabel")),
166 fCellHitLabel(p.get<std::string>("CellHitLabel")),
167 fClusterLabel(p.get<std::string>("ClusterLabel")),
168 fTrackLabel(p.get<std::string>("TrackLabel")),
169 fBackgroundSampleEnable(p.get<bool>("BackgroundSampleEnable")),
170 fBackgroundSampleDepth(p.get<int>("BackgroundSampleDepth")),
171 fMuonEndSphereRadius(p.get<int>("MuonEndSphereRadius")),
172 fMuonEndTimeCut(p.get<int>("MuonEndTimeCut")),
173 fEvt(0),
174 fRun(0),
175 fSubrun(0),
178 fTrigLength(0)
179 {
181 }
int fBackgroundSampleDepth
Number of events to look back for background sample.
sn::MichelBackgroundManager * fBkgManager
int fTrigNMicroslices
Number of microslices in trigger.
uint32_t fTrigLength
Duration of trigger (in ns)
const char * p
Definition: xmltok.h:285
int fMuonEndSphereRadius
Distance from end of muon track to veto.
unsigned long long fTrigUnixTimeStart
Unix time of trigger (in ns)
std::string fClusterLabel
ART module label for clusters.
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
std::string fCellHitLabel
ART module label for cell hits.
std::string fRawDataLabel
ART module label for raw data.
bool fBackgroundSampleEnable
Switch to enable collecting a background sample.
std::string fTrackLabel
ART module label for tracks.
int fMuonEndTimeCut
Time from end of muon track to veto.
enum BeamMode string
sn::SNMichelAnalyzer::SNMichelAnalyzer ( SNMichelAnalyzer const &  )
delete
sn::SNMichelAnalyzer::SNMichelAnalyzer ( SNMichelAnalyzer &&  )
delete

Member Function Documentation

void sn::SNMichelAnalyzer::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 302 of file SNMichelAnalyzer_module.cc.

References sn::MichelBackgroundManager::AddEntry(), ClusterAroundTrackEnds(), novadaq::timeutils::convertNovaTimeToUnixTime(), e, fBackgroundSampleEnable, fBkgManager, fEvt, art::fill_ptr_vector(), fRawDataLabel, fRun, fSubrun, fTrackLabel, fTreeBackground, fTreeMichels, rawdata::RawTrigger::fTriggerRange_TriggerLength, rawdata::RawTrigger::fTriggerTimingMarker_TimeStart, fTrigLength, fTrigNMicroslices, fTrigUnixTimeStart, art::DataViewImpl::getByLabel(), sn::MichelBackgroundManager::GetLastEntry(), GetTrackType(), sn::MichelBackgroundManager::IsReady(), sn::kStopping, rb::Cluster::MeanTNS(), art::Event::run(), sn::SortTracksByTime(), rb::Track::Stop(), art::Event::subRun(), msf_helper::timespec, and rawdata::DAQHeader::TotalMicroSlices().

303 {
304  fRun = e.run();
305  fSubrun = e.subRun();
306  ++fEvt;
307 
308  /* Get DAQHeader from event */
310  e.getByLabel(fRawDataLabel, daqheader);
311  fTrigNMicroslices = daqheader->TotalMicroSlices();
312 
313  /* Get RawTrigger info from event */
315  e.getByLabel(fRawDataLabel, trigs);
316  const rawdata::RawTrigger trig = trigs->at(0);
317 
318  /* Get trigger length and start time in Unix epoch (ms) */
319  struct timespec unixtime;
321 
322  fTrigUnixTimeStart = unixtime.tv_sec*1e3 + unixtime.tv_nsec*1e-6;
323  fTrigLength = trig.fTriggerRange_TriggerLength * 500; // units: ns
324 
325  /* Get Tracks from event, put them in a ptrVector, and sort them by time */
327  e.getByLabel(fTrackLabel, hdlTracks);
328  std::vector<art::Ptr<rb::Track>> tracks;
329  art::fill_ptr_vector(tracks, hdlTracks);
330  std::sort(tracks.begin(), tracks.end(), sn::SortTracksByTime);
331 
332  /* Get all the stoppoing track end points */
333  std::vector<std::pair<int, std::pair<double, TVector3>>> trackEnds;
334  for (size_t trackId=0; trackId<tracks.size(); ++trackId) {
335  rb::Track track = hdlTracks->at(trackId);
336  sn::TrackType trackType = this->GetTrackType(track);
337  double trackTNS = track.MeanTNS();
338 
339  // Only add the track end point if it's a stopping track
340  if (trackType == sn::TrackType::kStopping){
341  trackEnds.push_back(
342  std::pair<int, std::pair<double, TVector3>>(
343  trackId,
344  std::pair<double, TVector3>(trackTNS, track.Stop())
345  )
346  );
347  }
348  }
349 
351  if (fBkgManager->IsReady()) {
352  this->ClusterAroundTrackEnds(trackEnds, e, fTreeMichels, false);
354  }
355  fBkgManager->AddEntry(trackEnds);
356  } else {
357  this->ClusterAroundTrackEnds(trackEnds, e, fTreeMichels, false);
358  }
359 
360  return;
361 }
sn::MichelBackgroundManager * fBkgManager
int fTrigNMicroslices
Number of microslices in trigger.
void AddEntry(std::vector< std::pair< int, std::pair< double, TVector3 >>> entry)
uint32_t fTrigLength
Duration of trigger (in ns)
Definition: event.h:19
Track enters the detector and stops inside.
A rb::Prong with full reconstructed trajectory.
Definition: Track.h:20
int TotalMicroSlices() const
Definition: DAQHeader.h:27
bool convertNovaTimeToUnixTime(uint64_t const &inputNovaTime, struct timespec &outputUnixTime)
unsigned long long fTrigUnixTimeStart
Unix time of trigger (in ns)
bool SortTracksByTime(const art::Ptr< rb::Track > &t1, const art::Ptr< rb::Track > &t2)
std::vector< std::pair< int, std::pair< double, TVector3 > > > GetLastEntry()
void ClusterAroundTrackEnds(std::vector< std::pair< int, std::pair< double, TVector3 >>> trackEnds, art::Event const &e, TTree *&tree, bool kIsBackground=false)
std::string fRawDataLabel
ART module label for raw data.
unsigned long long fTriggerTimingMarker_TimeStart
Definition: RawTrigger.h:38
bool fBackgroundSampleEnable
Switch to enable collecting a background sample.
double MeanTNS(rb::AveragingScheme scheme=kDefaultScheme) const
Definition: Cluster.cxx:554
uint32_t fTriggerRange_TriggerLength
Definition: RawTrigger.h:40
sn::TrackType GetTrackType(rb::Track track)
TVector3 Stop() const
Position of the final trajectory point.
Definition: Track.cxx:186
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
std::string fTrackLabel
ART module label for tracks.
Float_t e
Definition: plot.C:35
void sn::SNMichelAnalyzer::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 185 of file SNMichelAnalyzer_module.cc.

References fBackgroundSampleEnable, fEvt, fMichelDistance, fMichelMeanTNS, fMichelNHits, fMichelSumADC, fMichelSumGeV, fMichelTimeDiff, fMichelTrackId, fRun, fSubrun, fTreeBackground, fTreeMichels, fTrigLength, fTrigNMicroslices, fTrigUnixTimeStart, and art::TFileDirectory::make().

186 {
188 
189  fTreeMichels = tfs->make<TTree>("Michels", "Michels");
190  fTreeMichels->Branch("Run", &fRun);
191  fTreeMichels->Branch("Subrun", &fSubrun);
192  fTreeMichels->Branch("Event", &fEvt);
193  fTreeMichels->Branch("TrigNMicroslices", &fTrigNMicroslices);
194  fTreeMichels->Branch("TrigUnixTimeStart", &fTrigUnixTimeStart);
195  fTreeMichels->Branch("TrigLength", &fTrigLength);
196  fTreeMichels->Branch("MichelSumADC", &fMichelSumADC);
197  fTreeMichels->Branch("MichelSumGeV", &fMichelSumGeV);
198  fTreeMichels->Branch("MichelMeanTNS", &fMichelMeanTNS);
199  fTreeMichels->Branch("MichelNHits", &fMichelNHits);
200  fTreeMichels->Branch("MichelTrackId", &fMichelTrackId);
201  fTreeMichels->Branch("MichelDistance", &fMichelDistance);
202  fTreeMichels->Branch("MichelTimeDiff", &fMichelTimeDiff);
203 
205  fTreeBackground = tfs->make<TTree>("Backgrounds", "Backgrounds");
206  fTreeBackground->Branch("MichelSumGeV", &fMichelSumGeV);
207  fTreeBackground->Branch("MichelMeanTNS", &fMichelMeanTNS);
208  fTreeBackground->Branch("MichelNHits", &fMichelNHits);
209  fTreeBackground->Branch("MichelTrackId", &fMichelTrackId);
210  fTreeBackground->Branch("MichelDistance", &fMichelDistance);
211  fTreeBackground->Branch("MichelTimeDiff", &fMichelTimeDiff);
212  }
213 
214  return;
215 }
int fTrigNMicroslices
Number of microslices in trigger.
float fMichelSumGeV
Total Michel cluster GeV.
uint32_t fTrigLength
Duration of trigger (in ns)
int fMichelSumADC
Total Michel cluster ADC.
float fMichelMeanTNS
Mean Michel cluster time (ns)
int fMichelTrackId
Identifier for stopping tracks.
unsigned long long fTrigUnixTimeStart
Unix time of trigger (in ns)
float fMichelDistance
Distance from Michel cluster to track.
T * make(ARGS...args) const
bool fBackgroundSampleEnable
Switch to enable collecting a background sample.
int fMichelNHits
Number of hits in Michel cluster.
float fMichelTimeDiff
Time diff from Michel cluster to track.
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
void sn::SNMichelAnalyzer::ClusterAroundTrackEnds ( std::vector< std::pair< int, std::pair< double, TVector3 >>>  trackEnds,
art::Event const &  e,
TTree *&  tree,
bool  kIsBackground = false 
)

Definition at line 219 of file SNMichelAnalyzer_module.cc.

References rb::Cluster::Add(), art::PtrVector< T >::begin(), rb::CellHit::Cell(), DistanceHitToPoint(), art::PtrVector< T >::end(), fCellHitLabel, fGeom, fMichelDistance, fMichelMeanTNS, fMichelNHits, fMichelSumADC, fMichelSumGeV, fMichelTimeDiff, fMichelTrackId, fMuonEndSphereRadius, fMuonEndTimeCut, fTrackLabel, art::DataViewImpl::getByLabel(), hits(), rb::Cluster::ID(), compare_h5_caf::idx, Mag(), rb::Cluster::MeanTNS(), rb::Cluster::MeanXYZ(), rb::Cluster::NCell(), rb::Cluster::NXCell(), rb::Cluster::NYCell(), rb::CellHit::Plane(), geo::GeometryBase::Plane(), rb::Cluster::SetID(), rb::SortByTime(), sn::SortTrackEndsByTime(), rb::CellHit::TNS(), rb::Cluster::TotalADC(), and rb::Cluster::TotalGeV().

Referenced by analyze().

220 {
221  /* Get CellHits from event, put them into a vector, and sort them by time */
223  e.getByLabel(fCellHitLabel, hdlHits);
224  std::vector<art::Ptr<rb::CellHit>> hits;
225  hits.reserve(hdlHits->size());
226  for (unsigned int idx=0; idx<hdlHits->size(); ++idx){
227  art::Ptr<rb::CellHit> hit(hdlHits, idx);
228  hits.push_back(hit);
229  }
230  rb::SortByTime(hits);
231 
232  std::sort(trackEnds.begin(), trackEnds.end(), sn::SortTrackEndsByTime);
233 
234  // This will allow us to extract the hits from a track as a cluster
236  e.getByLabel(fTrackLabel, hdlTracks);
237 
238  art::FindOneP<rb::Cluster> clusterFromTrack(hdlTracks, e, fTrackLabel);
239 
240  /* Loop over track ends and find nearby hits */
241  unsigned int idxStartCellHit = 0;
242  for (std::pair<int, std::pair<double, TVector3>> trackEnd : trackEnds) {
243  rb::Cluster* michelCluster = new rb::Cluster();
244  unsigned int trackId = trackEnd.first;
245  double trackTNS = trackEnd.second.first;
246  TVector3 xyz = trackEnd.second.second;
247 
248  art::PtrVector<rb::CellHit> trackHits;
249  if (!kIsBackground) {
250  trackHits = clusterFromTrack.at(trackId)->AllCells();
251  }
252 
253  for (size_t idx=idxStartCellHit; idx<hits.size(); ++idx) {
254  art::Ptr<rb::CellHit> hit = hits.at(idx);
255  if (hit->TNS() < trackTNS) {
256  idxStartCellHit = idx;
257  continue;
258  }
259 
260  if (!kIsBackground) {
261  if (std::find(trackHits.begin(), trackHits.end(), hit) != trackHits.end()) {
262  idxStartCellHit = idx;
263  continue;
264  }
265  }
266 
267  if (hit->TNS() > (trackTNS + fMuonEndTimeCut)) {
268  break;
269  }
270 
271  TVector3 cellCenter;
272  fGeom->Plane(hit->Plane())->Cell(hit->Cell())->GetCenter(cellCenter);
273 
274  float fDistance = this->DistanceHitToPoint(*hit, xyz);
275  if (fDistance < fMuonEndSphereRadius) {
276  michelCluster->Add(hit);
277  michelCluster->SetID(trackId);
278  }
279  }
280 
281  if (michelCluster->NXCell() > 0 && michelCluster->NYCell() > 0) {
282  fMichelNHits = michelCluster->NCell();
283  fMichelTrackId = michelCluster->ID();
284 
285  size_t cSize = michelCluster->NCell();
286  fMichelSumADC = (cSize==0) ? 0 : michelCluster->TotalADC();
287  fMichelSumGeV = (cSize==0) ? 0 : michelCluster->TotalGeV();
288  fMichelMeanTNS = (cSize==0) ? 0 : michelCluster->MeanTNS();
289  fMichelDistance = (cSize==0) ? 0 : (michelCluster->MeanXYZ() - xyz).Mag();
290  fMichelTimeDiff = (cSize==0) ? 0 : michelCluster->MeanTNS() - trackTNS;
291  tree->Fill();
292  }
293 
294  delete michelCluster;
295  }
296 
297  return;
298 }
float TNS() const
Definition: CellHit.h:46
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
float fMichelSumGeV
Total Michel cluster GeV.
unsigned short Plane() const
Definition: CellHit.h:39
iterator begin()
Definition: PtrVector.h:223
int fMichelSumADC
Total Michel cluster ADC.
int fMuonEndSphereRadius
Distance from end of muon track to veto.
A collection of associated CellHits.
Definition: Cluster.h:47
void SortByTime(std::vector< art::Ptr< rb::CellHit > > &c)
Sort c in time order (earliest to latest).
Definition: CellHit.cxx:134
const PlaneGeo * Plane(unsigned int i) const
TVector3 MeanXYZ(rb::AveragingScheme=kDefaultScheme) const
Definition: Cluster.cxx:538
float fMichelMeanTNS
Mean Michel cluster time (ns)
virtual void Add(const art::Ptr< rb::CellHit > &cell, double weight=1)
Definition: Cluster.cxx:84
int fMichelTrackId
Identifier for stopping tracks.
unsigned short Cell() const
Definition: CellHit.h:40
double TotalADC() const
Sum of the ADC of all the contained hits.
Definition: Cluster.cxx:360
void hits()
Definition: readHits.C:15
iterator end()
Definition: PtrVector.h:237
double DistanceHitToPoint(const rb::CellHit hit, const TVector3 point)
float fMichelDistance
Distance from Michel cluster to track.
void SetID(int id)
Definition: Cluster.h:74
reference at(size_type n)
Definition: PtrVector.h:365
std::string fCellHitLabel
ART module label for cell hits.
unsigned int NYCell() const
Number of cells in the y-view.
Definition: Cluster.h:108
Definition: structs.h:12
unsigned int NXCell() const
Number of cells in the x-view.
Definition: Cluster.h:106
double MeanTNS(rb::AveragingScheme scheme=kDefaultScheme) const
Definition: Cluster.cxx:554
art::ServiceHandle< geo::Geometry > fGeom
bool SortTrackEndsByTime(const std::pair< int, std::pair< double, TVector3 >> &t1, const std::pair< int, std::pair< double, TVector3 >> &t2)
float Mag() const
int fMichelNHits
Number of hits in Michel cluster.
double TotalGeV(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple sum of the estimated GeV of all the hits.
Definition: Cluster.cxx:378
const int ID() const
Definition: Cluster.h:75
std::string fTrackLabel
ART module label for tracks.
Float_t e
Definition: plot.C:35
int fMuonEndTimeCut
Time from end of muon track to veto.
float fMichelTimeDiff
Time diff from Michel cluster to track.
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
double sn::SNMichelAnalyzer::DistanceHitToPoint ( const rb::CellHit  hit,
const TVector3  point 
)

Return the distance between a cell hit and a point in space.

Parameters
[in]hitrb::CellHit
[in]pointTVector3
Returns
distance between the hit and the point

Definition at line 383 of file SNMichelAnalyzer_module.cc.

References rb::CellHit::Cell(), fGeom, geo::kX, geo::kY, rb::CellHit::Plane(), geo::GeometryBase::Plane(), rb::CellHit::View(), w, and x1.

Referenced by ClusterAroundTrackEnds().

384 {
385  // Get hit and track vectors in XYZ-space
386  TVector3 x0;
387  TVector3 x1 = point;
388 
389  // Note: x0 is passed by reference here, and thus assigned at this line
390  fGeom->Plane(hit.Plane())->Cell(hit.Cell())->GetCenter(x0);
391 
392  // Define ZW coordinate system based on the view of the hit
393  TVector3 w(0,0,0);
394  if (hit.View() == geo::kX) w.SetX(1);
395  if (hit.View() == geo::kY) w.SetY(1);
396 
397  // Transform from XYZ-space into ZW-space
398  TVector3 w0(x0.Z(), x0.Dot(w), 0);
399  TVector3 w1(x1.Z(), x1.Dot(w), 0);
400 
401  return (w1-w0).Mag();
402 }
unsigned short Plane() const
Definition: CellHit.h:39
Float_t x1[n_points_granero]
Definition: compare.C:5
geo::View_t View() const
Definition: CellHit.h:41
Vertical planes which measure X.
Definition: PlaneGeo.h:28
const PlaneGeo * Plane(unsigned int i) const
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
unsigned short Cell() const
Definition: CellHit.h:40
art::ServiceHandle< geo::Geometry > fGeom
Float_t w
Definition: plot.C:20
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
sn::TrackType sn::SNMichelAnalyzer::GetTrackType ( rb::Track  track)

Definition at line 365 of file SNMichelAnalyzer_module.cc.

References sn::kContained, sn::kExiting, sn::kStopping, sn::kThroughGoing, sn::kUnknown, PointIsContained(), rb::Prong::Start(), and rb::Track::Stop().

Referenced by analyze().

366 {
367  if (!PointIsContained(track.Start()) && PointIsContained(track.Stop())) return sn::TrackType::kStopping;
368  else if (!PointIsContained(track.Start()) && !PointIsContained(track.Stop())) return sn::TrackType::kThroughGoing;
369  else if ( PointIsContained(track.Start()) && PointIsContained(track.Stop())) return sn::TrackType::kContained;
370  else if ( PointIsContained(track.Start()) && !PointIsContained(track.Stop())) return sn::TrackType::kExiting;
371  else return sn::TrackType::kUnknown;
372 }
Track enters the detector and stops inside.
virtual TVector3 Start() const
Definition: Prong.h:73
Track type is none of the below.
bool PointIsContained(TVector3 point)
Track starts inside the detector and exits.
Track enters and exits the detector.
Track starts and ends entirely inside the detector.
TVector3 Stop() const
Position of the final trajectory point.
Definition: Track.cxx:186
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
SNMichelAnalyzer& sn::SNMichelAnalyzer::operator= ( SNMichelAnalyzer const &  )
delete
SNMichelAnalyzer& sn::SNMichelAnalyzer::operator= ( SNMichelAnalyzer &&  )
delete
bool sn::SNMichelAnalyzer::PointIsContained ( TVector3  point)

Definition at line 406 of file SNMichelAnalyzer_module.cc.

Referenced by GetTrackType().

407 {
408  return (point.X() > -720) && (point.X() < 720) &&
409  (point.Y() > -720) && (point.Y() < 700) &&
410  (point.Z() > 80) && (point.Z() < 5920);
411 }
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

int sn::SNMichelAnalyzer::fBackgroundSampleDepth
private

Number of events to look back for background sample.

Definition at line 135 of file SNMichelAnalyzer_module.cc.

Referenced by SNMichelAnalyzer().

bool sn::SNMichelAnalyzer::fBackgroundSampleEnable
private

Switch to enable collecting a background sample.

Definition at line 134 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

sn::MichelBackgroundManager* sn::SNMichelAnalyzer::fBkgManager
private

Definition at line 158 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and SNMichelAnalyzer().

std::string sn::SNMichelAnalyzer::fCellHitLabel
private

ART module label for cell hits.

Definition at line 130 of file SNMichelAnalyzer_module.cc.

Referenced by ClusterAroundTrackEnds().

std::string sn::SNMichelAnalyzer::fClusterLabel
private

ART module label for clusters.

Definition at line 131 of file SNMichelAnalyzer_module.cc.

int sn::SNMichelAnalyzer::fEvt
private

Event number.

Definition at line 140 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

art::ServiceHandle<geo::Geometry> sn::SNMichelAnalyzer::fGeom
private

Definition at line 157 of file SNMichelAnalyzer_module.cc.

Referenced by ClusterAroundTrackEnds(), and DistanceHitToPoint().

float sn::SNMichelAnalyzer::fMichelDistance
private

Distance from Michel cluster to track.

Definition at line 148 of file SNMichelAnalyzer_module.cc.

Referenced by beginJob(), and ClusterAroundTrackEnds().

float sn::SNMichelAnalyzer::fMichelMeanTNS
private

Mean Michel cluster time (ns)

Definition at line 145 of file SNMichelAnalyzer_module.cc.

Referenced by beginJob(), and ClusterAroundTrackEnds().

int sn::SNMichelAnalyzer::fMichelNHits
private

Number of hits in Michel cluster.

Definition at line 146 of file SNMichelAnalyzer_module.cc.

Referenced by beginJob(), and ClusterAroundTrackEnds().

int sn::SNMichelAnalyzer::fMichelSumADC
private

Total Michel cluster ADC.

Definition at line 143 of file SNMichelAnalyzer_module.cc.

Referenced by beginJob(), and ClusterAroundTrackEnds().

float sn::SNMichelAnalyzer::fMichelSumGeV
private

Total Michel cluster GeV.

Definition at line 144 of file SNMichelAnalyzer_module.cc.

Referenced by beginJob(), and ClusterAroundTrackEnds().

float sn::SNMichelAnalyzer::fMichelTimeDiff
private

Time diff from Michel cluster to track.

Definition at line 149 of file SNMichelAnalyzer_module.cc.

Referenced by beginJob(), and ClusterAroundTrackEnds().

int sn::SNMichelAnalyzer::fMichelTrackId
private

Identifier for stopping tracks.

Definition at line 147 of file SNMichelAnalyzer_module.cc.

Referenced by beginJob(), and ClusterAroundTrackEnds().

int sn::SNMichelAnalyzer::fMuonEndSphereRadius
private

Distance from end of muon track to veto.

Definition at line 137 of file SNMichelAnalyzer_module.cc.

Referenced by ClusterAroundTrackEnds().

int sn::SNMichelAnalyzer::fMuonEndTimeCut
private

Time from end of muon track to veto.

Definition at line 138 of file SNMichelAnalyzer_module.cc.

Referenced by ClusterAroundTrackEnds().

std::string sn::SNMichelAnalyzer::fRawDataLabel
private

ART module label for raw data.

Definition at line 129 of file SNMichelAnalyzer_module.cc.

Referenced by analyze().

int sn::SNMichelAnalyzer::fRun
private

Run number.

Definition at line 141 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

int sn::SNMichelAnalyzer::fSubrun
private

Subrun number.

Definition at line 142 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

std::string sn::SNMichelAnalyzer::fTrackLabel
private

ART module label for tracks.

Definition at line 132 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and ClusterAroundTrackEnds().

TTree* sn::SNMichelAnalyzer::fTreeBackground
private

Definition at line 155 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

TTree* sn::SNMichelAnalyzer::fTreeMichels
private

Definition at line 154 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

uint32_t sn::SNMichelAnalyzer::fTrigLength
private

Duration of trigger (in ns)

Definition at line 152 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

int sn::SNMichelAnalyzer::fTrigNMicroslices
private

Number of microslices in trigger.

Definition at line 150 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

unsigned long long sn::SNMichelAnalyzer::fTrigUnixTimeStart
private

Unix time of trigger (in ns)

Definition at line 151 of file SNMichelAnalyzer_module.cc.

Referenced by analyze(), and beginJob().


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