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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 CosmicMetrics (fhicl::ParameterSet const &pset)
 
virtual ~CosmicMetrics ()
 
void analyze (art::Event const &evt)
 The analysis of CosmicTrack reconstructed tracks in roder to calculate cosmic ray muon rates, track lengths and more cosmic ray metrics to be monitored for commissioning. More...
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void beginJob ()
 
void endJob ()
 
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 Member Functions

bool IsEntering (double x, double y, double z)
 yes/no is "track" entering within a buffer window More...
 

Private Attributes

std::string fRawDataLabel
 Where to find RawData. More...
 
std::string fCellHitsListLabel
 Where to find CellHits. More...
 
std::string fTrackLabel
 Where to find Tracks. More...
 
std::string fSoftwareRelease
 Software release. More...
 
double fTrkLengthCut
 Minimum length of track to accept [cm]. More...
 
double fMinTDC
 Minimum TDC value to accept track. More...
 
double fMaxTDC
 Maximum TDC value to accept track. More...
 
unsigned int fMuonNhit
 Required # hits on muon track. More...
 
unsigned int fMuonNhitX
 

required in x view

More...
 
unsigned int fMuonNhitY
 

required in y view

More...
 
double fDetEdgeBuffer
 Detector edge buffer zone for entering cosmic ray track decision [cm]. More...
 
unsigned int fNevents
 total number of events counter More...
 
int fNTracks
 total number of reconstructed tracks counter, using time cuts More...
 
int fRun
 Run number. More...
 
int fSubRun
 Subrun number. More...
 
unsigned int fTriggerType
 
int fWriteToDB
 
TH1D * fTrackLength
 length of track [cm] More...
 
TH1D * fCosCosmic
 cosine theta of cosmic track with respect to zenith More...
 
TH1D * fCosmicRate
 histogram holding single value for cosmic rate at end of job [Hz] More...
 
TH1D * fNEvents
 total number of events More...
 
TH1D * fTNS [2]
 distribution of XZ/YZ CellHit times in nano seconds More...
 

Detailed Description

Definition at line 35 of file CosmicMetrics_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

comi::CosmicMetrics::CosmicMetrics ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 85 of file CosmicMetrics_module.cc.

References reconfigure().

85  :
86  EDAnalyzer(pset),
87  fRawDataLabel (pset.get< std::string >("RawDataLabel") ),
88  fCellHitsListLabel(pset.get< std::string >("CellHitsListLabel") ),
89  fTrackLabel (pset.get< std::string >("TrackLabel") ),
90  fTrkLengthCut (pset.get< double >("TrkLengthCut") ),
91  fMinTDC (pset.get< double >("MinTDC") ),
92  fMaxTDC (pset.get< double >("MaxTDC") ),
93  fMuonNhit (pset.get< unsigned int>("MuonNhit") ),
94  fMuonNhitX (pset.get< unsigned int>("MuonNhitX") ),
95  fMuonNhitY (pset.get< unsigned int>("MuonNhitY") ),
96  fDetEdgeBuffer (pset.get< double >("DetEdgeBuffer") ),
97  fNevents(0), fNTracks(0), fRun(-999), fSubRun(-999), fTriggerType(-999)
98  {
99  reconfigure(pset);
100  }
std::string fTrackLabel
Where to find Tracks.
std::string fCellHitsListLabel
Where to find CellHits.
unsigned int fMuonNhit
Required # hits on muon track.
unsigned int fMuonNhitY
required in y view
double fMaxTDC
Maximum TDC value to accept track.
unsigned int fMuonNhitX
required in x view
unsigned int fNevents
total number of events counter
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
int fNTracks
total number of reconstructed tracks counter, using time cuts
std::string fRawDataLabel
Where to find RawData.
double fTrkLengthCut
Minimum length of track to accept [cm].
double fMinTDC
Minimum TDC value to accept track.
double fDetEdgeBuffer
Detector edge buffer zone for entering cosmic ray track decision [cm].
void reconfigure(const fhicl::ParameterSet &pset)
int fSubRun
Subrun number.
enum BeamMode string
comi::CosmicMetrics::~CosmicMetrics ( )
virtual

Definition at line 104 of file CosmicMetrics_module.cc.

105  {
106  }

Member Function Documentation

void comi::CosmicMetrics::analyze ( art::Event const &  evt)
virtual

The analysis of CosmicTrack reconstructed tracks in roder to calculate cosmic ray muon rates, track lengths and more cosmic ray metrics to be monitored for commissioning.

Parameters
evt- Read-only access to the event data

Implements art::EDAnalyzer.

Definition at line 135 of file CosmicMetrics_module.cc.

References ana::assert(), rb::Cluster::Cell(), dir, rb::Prong::Dir(), febshutoff_auto::end, stan::math::fabs(), fCosCosmic, fMaxTDC, fMinTDC, fMuonNhit, fMuonNhitX, fMuonNhitY, fNevents, fNEvents, fNTracks, fRawDataLabel, fRun, fSubRun, fTNS, fTrackLabel, fTrackLength, rawdata::RawTrigger::fTriggerMask_TriggerType, fTriggerType, fTrkLengthCut, geom(), art::DataViewImpl::getByLabel(), IsEntering(), geo::kX, geo::kY, demo0::length, LOG_DEBUG, rb::Cluster::NCell(), rb::Cluster::NXCell(), rb::Cluster::NYCell(), util::pythag(), art::Event::run(), febshutoff_auto::start, rb::Prong::Start(), rb::Track::Stop(), art::Event::subRun(), std::swap(), rb::CellHit::TNS(), track, and POTSpillRate::view.

136  {
137 
139 
140  ++fNevents; //Updating counter of number of events in sub-run
141  if(fRun < 0) fRun = evt.run();
142  if(fSubRun < 0) fSubRun = evt.subRun();
143  fNEvents->Fill(1);
144 
146  evt.getByLabel(fRawDataLabel, trigv);
147  const rawdata::RawTrigger& trig = (*trigv)[0];
149 
150  // now get the tracks that were made by CosmicTrack
151  // and check that there are tracks in the event
153  evt.getByLabel(fTrackLabel,trks);
154  if (trks->size()==0) {
155  mf::LogWarning("CosmicMetricsWarn") << "There are " << trks->size()
156  << " Tracks in this event, skip";
157  return;
158  }
159  LOG_DEBUG("CosmicMetrics") << "There are " << trks->size() << " Tracks in this event";
160 
161  const unsigned int trkMax = trks->size(); // maximum number of tracks in event
162  double cosCosmic = 0.;
163  int numtracks = 0 ;
164 
165  // Loop over tracks
166  for(unsigned int trkIdx = 0; trkIdx < trkMax; ++trkIdx){
167 
168  bool isgoodXZtrack = false;
169  bool isgoodYZtrack = false;
170 
171  art::Ptr<rb::Track> track(trks, trkIdx); // ART-pointer to each track in event
172 
173  // Get vectors for the end points of the track
174  TVector3 start(track->Start());
175  TVector3 end(track->Stop());
176  TVector3 dir(track->Dir());
177  TVector3 length = end - start;
178 
179  if(end.Y() > start.Y()) std::swap(start, end); // force start point in Y to be greater than end point in Y for cosmics
180 
181  // Does this look like an entering track?
182  if (this->IsEntering(start.X(),start.Y(),start.Z()) == false) continue;
183 
184  const unsigned int hitMax = track->NCell(); // maximum number of CellHits on track
185  const unsigned int hitX = track->NXCell(); // maximum number of CellHits on track in XZ
186  const unsigned int hitY = track->NYCell(); // maximum number of CellHits on track in YZ
187 
188  // Do NOT select tracks if max number of hits or XZ- YZ-hits less than configurable values
189  if ( (hitMax < fMuonNhit) || (hitX < fMuonNhitX) || (hitY < fMuonNhitY) ) continue;
190  assert((track->NXCell() > 0) && (track->NYCell() > 0));
191 
192  double TNS[2] = {0.}; // TNS() value in each view
193  double TNStotal[2] = {0.}; // total TNS() in each view
194  double TNSaverage[2] = {0.}; // average TNS() in each view
195 
196  // Only select tracks that cross more than fTrkLengthCut [cm] in Z
197  if(fabs(end.Z() - start.Z()) > fTrkLengthCut){
198 
199  fTrackLength->Fill(length.Mag());
200 
201  // Loop through both views and grab every CellHit in this track
202  for(int view = geo::kX; view <= geo::kY; ++view){
203  // C++ is a bit strict about the conversions. Save typing.
204  const geo::View_t geoview = geo::View_t(view);
205  const int vhitMax = track->NCell(geoview);
206 
207  for(int hitIdx = 0; hitIdx < vhitMax; ++hitIdx){
208 
209  art::Ptr<rb::CellHit> chit = track->Cell(geoview, hitIdx);
210  fTNS[view]->Fill(chit->TNS());
211  TNS[view] = chit->TNS();
212  TNStotal[view]+=TNS[view];
213  } // hitIdx
214 
215  TNSaverage[view] = TNStotal[view]/track->NCell(geoview); // average TNS() CellHits in each view
216  } // view
217  } // track length cut
218 
219  if(TNSaverage[geo::kX] >= fMinTDC && TNSaverage[geo::kX] <= fMaxTDC){
220  isgoodXZtrack = true;
221  }
222  if(TNSaverage[geo::kY] >= fMinTDC && TNSaverage[geo::kY] <= fMaxTDC){
223  isgoodYZtrack = true;
224  }
225 
226  // Only count 3D tracks within configurable window size and with matching XZ/YZ 2D tracks
227  if(isgoodXZtrack == true && isgoodYZtrack == true){
228  numtracks++;
229  }
230 
231  // Cosmic track angular distribution with respect to zenith
232  cosCosmic = TMath::Abs(-dir.Y()/util::pythag(dir.X(),dir.Y(),dir.Z()));
233  fCosCosmic->Fill(cosCosmic);
234 
235  } // loop over tracks
236  fNTracks += numtracks;
237 
238  return;
239  }
float TNS() const
Definition: CellHit.h:46
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
std::string fTrackLabel
Where to find Tracks.
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
TH1D * fNEvents
total number of events
bool IsEntering(double x, double y, double z)
yes/no is "track" entering within a buffer window
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Vertical planes which measure X.
Definition: PlaneGeo.h:28
Definition: event.h:19
TH1D * fTrackLength
length of track [cm]
unsigned int fMuonNhit
Required # hits on muon track.
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
unsigned int fMuonNhitY
required in y view
uint8_t fTriggerMask_TriggerType
Definition: RawTrigger.h:43
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
double fMaxTDC
Maximum TDC value to accept track.
unsigned int fMuonNhitX
required in x view
TH1D * fTNS[2]
distribution of XZ/YZ CellHit times in nano seconds
length
Definition: demo0.py:21
unsigned int fNevents
total number of events counter
int evt
int fNTracks
total number of reconstructed tracks counter, using time cuts
std::string fRawDataLabel
Where to find RawData.
double fTrkLengthCut
Minimum length of track to accept [cm].
TDirectory * dir
Definition: macro.C:5
double pythag(double x, double y)
2D Euclidean distance
Definition: MathUtil.h:29
double fMinTDC
Minimum TDC value to accept track.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void geom(int which=0)
Definition: geom.C:163
TH1D * fCosCosmic
cosine theta of cosmic track with respect to zenith
assert(nhit_max >=nhit_nbins)
Float_t track
Definition: plot.C:35
int fSubRun
Subrun number.
void comi::CosmicMetrics::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 110 of file CosmicMetrics_module.cc.

References fCosCosmic, fCosmicRate, fNEvents, fTNS, fTrackLength, geo::kX, geo::kY, art::TFileDirectory::make(), and POTSpillRate::view.

111  {
113 
114  fNEvents = tfs->make<TH1D>("fNEvents",";;Number of events",2,0,2);
115  fTrackLength = tfs->make<TH1D>("trackLength", ";Track Length (cm);" , 100, 0., 1000.);
116  fCosCosmic = tfs->make<TH1D>("coscosmic",";Cos #theta wrt zenith",1000,0.,1.);
117  fCosmicRate = tfs->make<TH1D>("cosmicrate",";Cosmic Rate (Hz)",1,0.,100000);
118 
119  for(int view = geo::kX; view <= geo::kY; ++view){
120  const TString viewStr = (view == geo::kX) ? "X" : "Y";
121  fTNS[view] = tfs->make<TH1D>("HitTNS"+viewStr, ";Time (ns);hits", 70, -100000.0, 600000.);
122  }
123  }
TH1D * fNEvents
total number of events
Vertical planes which measure X.
Definition: PlaneGeo.h:28
TH1D * fTrackLength
length of track [cm]
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
TH1D * fTNS[2]
distribution of XZ/YZ CellHit times in nano seconds
TH1D * fCosmicRate
histogram holding single value for cosmic rate at end of job [Hz]
T * make(ARGS...args) const
TH1D * fCosCosmic
cosine theta of cosmic track with respect to zenith
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_
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
void comi::CosmicMetrics::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 254 of file CosmicMetrics_module.cc.

References nova::database::Table::AddRow(), om::cerr, om::cout, geo::GeometryBase::DetId(), allTimeWatchdog::endl, fCosmicRate, fMaxTDC, fMinTDC, fNevents, fNTracks, fRun, fSoftwareRelease, fSubRun, fTrackLength, fTriggerType, fWriteToDB, geom(), cet::getenv(), novadaq::cnv::DetInfo::GetName(), nova::database::Table::LoadFromDB(), nova::database::Table::NewRow(), nova::database::Table::NRow(), ns, r(), nova::database::Row::Set(), nova::database::Table::SetDetector(), nova::database::Table::SetValidityRange(), string, confusionMatrixTree::t, and nova::database::Table::WriteToDB().

255  {
256 
257 
259 
260  float fLivetime = fNevents*((fMaxTDC-fMinTDC)*ns);
261  float fCosmicrate = fNTracks/(fNevents*((fMaxTDC-fMinTDC)*ns));
262  std::cout<< "There are: " << fNevents << " events in this job.\n";
263  std::cout<< "There are: " << fNTracks << " tracks selected in this job.\n";
264  std::cout<< "The livetime is " << fLivetime << "!\n";
265  std::cout<< "The cosmic rate is therefore " << fCosmicrate << " Hz \n";
266  std::cout<< "tracklengthmean="<<fTrackLength->GetMean(1)<<std::endl;
267  std::cout<< "tracklengthrms=" <<fTrackLength->GetRMS(1) <<std::endl;
268  fCosmicRate->Fill(fCosmicrate);
269 
270  //Get software release
271  fSoftwareRelease = getenv("SRT_BASE_RELEASE");
272 
273  if (fWriteToDB) {
274 
275  nova::database::Table* t = new nova::database::Table(std::string("/Commissioning/tables/CosmicMetrics.xml"));
276 
277  t->SetDetector(geom->DetId());
278  t->SetValidityRange("detector", novadaq::cnv::DetInfo::GetName(geom->DetId()));
279  t->SetValidityRange("run",fRun);
280  t->SetValidityRange("subrun",fSubRun);
281  t->SetValidityRange("triggertype",fTriggerType);
282  t->SetValidityRange("softwarerelease", fSoftwareRelease);
283  t->LoadFromDB();
284  if ( t->NRow() ){
285  std::cerr<< " Subrun metrics are already in the database "<<std::endl;
286  }
287  else{
288  std::cout<< " Writting subrun metrics to the database "<<std::endl;
289 
290  nova::database::Row* r = t->NewRow();
291 
292  r->Set("detector", novadaq::cnv::DetInfo::GetName(geom->DetId()));
293  r->Set("run", fRun);
294  r->Set("subrun", fSubRun);
295  r->Set("triggertype", fTriggerType);
296  r->Set("nevents", fNevents);
297  r->Set("ntracks", fNTracks);
298  r->Set("livetime", fLivetime);
299  r->Set("cosmicrate", fCosmicrate);
300  r->Set("tracklengthmean", fTrackLength->GetMean(1));
301  r->Set("tracklengthrms", fTrackLength->GetRMS(1));
302  r->Set("softwarerelease", fSoftwareRelease);
303 
304  t->AddRow(r);
305  delete r;
306  t->WriteToDB();
307  }
308  }
309  }
static std::string GetName(int id)
bool Set(std::string cname, T value)
Definition: Row.h:30
OStream cerr
Definition: OStream.cxx:7
TH1D * fTrackLength
length of track [cm]
bool SetValidityRange(std::string cname, T start, T end)
Definition: Table.h:206
double fMaxTDC
Maximum TDC value to accept track.
bool WriteToDB(bool commit=true)
use commit=false if just testing
Definition: Table.cpp:1810
std::string getenv(std::string const &name)
unsigned int fNevents
total number of events counter
static const double ns
Module that plots metrics from reconstructed cosmic ray data.
void AddRow(const Row *row)
Definition: Table.cpp:727
bool SetDetector(std::string det)
Definition: Table.cpp:513
OStream cout
Definition: OStream.cxx:6
TH1D * fCosmicRate
histogram holding single value for cosmic rate at end of job [Hz]
std::string fSoftwareRelease
Software release.
int fNTracks
total number of reconstructed tracks counter, using time cuts
struct Table Table
Definition: TexBuilder.h:2
double fMinTDC
Minimum TDC value to accept track.
void geom(int which=0)
Definition: geom.C:163
TRandom3 r(0)
int fSubRun
Subrun number.
enum BeamMode string
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
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
bool comi::CosmicMetrics::IsEntering ( double  x,
double  y,
double  z 
)
private

yes/no is "track" entering within a buffer window

Definition at line 313 of file CosmicMetrics_module.cc.

References DEFINE_ART_MODULE(), geo::GeometryBase::DetHalfHeight(), geo::GeometryBase::DetHalfWidth(), geo::GeometryBase::DetLength(), stan::math::fabs(), fDetEdgeBuffer, and geom().

Referenced by analyze().

314  {
316  if (y > geom->DetHalfHeight()-fDetEdgeBuffer) return true;
317  if (fabs(x) > geom->DetHalfWidth()-fDetEdgeBuffer) return true;
318  if (z < fDetEdgeBuffer) return true;
319  if (z > geom->DetLength()-fDetEdgeBuffer) return true;
320  return false;
321  }
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
double DetLength() const
double DetHalfHeight() const
z
Definition: test.py:28
double DetHalfWidth() const
void geom(int which=0)
Definition: geom.C:163
double fDetEdgeBuffer
Detector edge buffer zone for entering cosmic ray track decision [cm].
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
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void comi::CosmicMetrics::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 243 of file CosmicMetrics_module.cc.

References fDetEdgeBuffer, fMaxTDC, fMinTDC, fTrkLengthCut, fWriteToDB, and fhicl::ParameterSet::get().

Referenced by CosmicMetrics().

244  {
245  fTrkLengthCut = pset.get< double >("TrkLengthCut" );
246  fMinTDC = pset.get< double >("MinTDC" );
247  fMaxTDC = pset.get< double >("MaxTDC" );
248  fDetEdgeBuffer= pset.get< double >("DetEdgeBuffer");
249  fWriteToDB = pset.get< int >("WriteToDB");
250  }
double fMaxTDC
Maximum TDC value to accept track.
T get(std::string const &key) const
Definition: ParameterSet.h:231
double fTrkLengthCut
Minimum length of track to accept [cm].
double fMinTDC
Minimum TDC value to accept track.
double fDetEdgeBuffer
Detector edge buffer zone for entering cosmic ray track decision [cm].
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

std::string comi::CosmicMetrics::fCellHitsListLabel
private

Where to find CellHits.

Definition at line 50 of file CosmicMetrics_module.cc.

TH1D* comi::CosmicMetrics::fCosCosmic
private

cosine theta of cosmic track with respect to zenith

Definition at line 72 of file CosmicMetrics_module.cc.

Referenced by analyze(), and beginJob().

TH1D* comi::CosmicMetrics::fCosmicRate
private

histogram holding single value for cosmic rate at end of job [Hz]

Definition at line 73 of file CosmicMetrics_module.cc.

Referenced by beginJob(), and endJob().

double comi::CosmicMetrics::fDetEdgeBuffer
private

Detector edge buffer zone for entering cosmic ray track decision [cm].

Definition at line 60 of file CosmicMetrics_module.cc.

Referenced by IsEntering(), and reconfigure().

double comi::CosmicMetrics::fMaxTDC
private

Maximum TDC value to accept track.

Definition at line 56 of file CosmicMetrics_module.cc.

Referenced by analyze(), endJob(), and reconfigure().

double comi::CosmicMetrics::fMinTDC
private

Minimum TDC value to accept track.

Definition at line 55 of file CosmicMetrics_module.cc.

Referenced by analyze(), endJob(), and reconfigure().

unsigned int comi::CosmicMetrics::fMuonNhit
private

Required # hits on muon track.

Definition at line 57 of file CosmicMetrics_module.cc.

Referenced by analyze().

unsigned int comi::CosmicMetrics::fMuonNhitX
private

required in x view

Definition at line 58 of file CosmicMetrics_module.cc.

Referenced by analyze().

unsigned int comi::CosmicMetrics::fMuonNhitY
private

required in y view

Definition at line 59 of file CosmicMetrics_module.cc.

Referenced by analyze().

unsigned int comi::CosmicMetrics::fNevents
private

total number of events counter

Definition at line 62 of file CosmicMetrics_module.cc.

Referenced by analyze(), and endJob().

TH1D* comi::CosmicMetrics::fNEvents
private

total number of events

Definition at line 74 of file CosmicMetrics_module.cc.

Referenced by analyze(), and beginJob().

int comi::CosmicMetrics::fNTracks
private

total number of reconstructed tracks counter, using time cuts

Definition at line 63 of file CosmicMetrics_module.cc.

Referenced by analyze(), and endJob().

std::string comi::CosmicMetrics::fRawDataLabel
private

Where to find RawData.

Definition at line 49 of file CosmicMetrics_module.cc.

Referenced by analyze().

int comi::CosmicMetrics::fRun
private

Run number.

Definition at line 64 of file CosmicMetrics_module.cc.

Referenced by analyze(), and endJob().

std::string comi::CosmicMetrics::fSoftwareRelease
private

Software release.

Definition at line 52 of file CosmicMetrics_module.cc.

Referenced by endJob().

int comi::CosmicMetrics::fSubRun
private

Subrun number.

Definition at line 65 of file CosmicMetrics_module.cc.

Referenced by analyze(), and endJob().

TH1D* comi::CosmicMetrics::fTNS[2]
private

distribution of XZ/YZ CellHit times in nano seconds

Definition at line 75 of file CosmicMetrics_module.cc.

Referenced by analyze(), and beginJob().

std::string comi::CosmicMetrics::fTrackLabel
private

Where to find Tracks.

Definition at line 51 of file CosmicMetrics_module.cc.

Referenced by analyze().

TH1D* comi::CosmicMetrics::fTrackLength
private

length of track [cm]

Definition at line 71 of file CosmicMetrics_module.cc.

Referenced by analyze(), beginJob(), and endJob().

unsigned int comi::CosmicMetrics::fTriggerType
private

Definition at line 66 of file CosmicMetrics_module.cc.

Referenced by analyze(), and endJob().

double comi::CosmicMetrics::fTrkLengthCut
private

Minimum length of track to accept [cm].

Definition at line 54 of file CosmicMetrics_module.cc.

Referenced by analyze(), and reconfigure().

int comi::CosmicMetrics::fWriteToDB
private

Definition at line 67 of file CosmicMetrics_module.cc.

Referenced by endJob(), and reconfigure().


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