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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 FastMMStudy (fhicl::ParameterSet const &p)
 
 FastMMStudy (FastMMStudy const &)=delete
 
 FastMMStudy (FastMMStudy &&)=delete
 
FastMMStudyoperator= (FastMMStudy const &)=delete
 
FastMMStudyoperator= (FastMMStudy &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
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

void tset (std::string const &branch_name, double const &value)
 
void tset2 (std::string const &branch_name, double const &value)
 
void StdevCellsPerPlane (rb::Cluster const &hits, double &stdev_cells_per_plane_xview, double &stdev_cells_per_plane_yview) const
 
void NumberOfCellsPerLength (rb::Cluster const &hits, double tracklength_of_xview, double tracklength_of_yview, double &number_of_cells_per_length_xview, double &number_of_cells_per_length_yview) const
 
float Distance (unsigned const &xcell1, unsigned const &ycell1, unsigned const &plane1, unsigned const &xcell2, unsigned const &ycell2, unsigned const &plane2) const
 
bool SurfAssign (rb::CellHit const &hit) const
 
int GetSurfaceId (rb::CellHit const &hit) const
 
double WeightedCenterCut (rb::Cluster const &hits, float PX_min, float PX_max, float PY_min, float PY_max, float CX_min, float CX_max, float CY_min, float CY_max, double &weighted_off_center_xx, double &weighted_off_center_xz, double &weighted_off_center_yy, double &weighted_off_center_yz) const
 
double NumberOfHitsInOverlapPlanesCut (rb::Cluster const &hits, float PX_min, float PX_max, float PY_min, float PY_max) const
 
int NumberOfSurfaceHits (rb::Cluster const &hits) const
 
void LinFit (const std::vector< double > &x, const std::vector< double > &y, double *fitpar)
 

Private Attributes

std::string _slicelabel
 
std::string _sliceinstance
 
int nxhits_MC
 
int nyhits_MC
 
double ti_MC
 
double tf_MC
 
double beta_MC
 
int _xMin
 
int _xMax
 
int _yMin
 
int _yMax
 
int _zMin
 
int _zMax
 
int _deltx
 
int _delty
 
int _deltz
 
int _sigmaP
 
int _trueHits
 
int _nSatHits
 
double _stdevcellsperplane
 
double _MaxHitsPerLength
 
double _MaxOffCenter
 
int _MinNumberSurfaceHits
 
int PX_max
 
int PY_max
 
int PX_min
 
int PY_min
 
int CX_max
 
int CX_min
 
int CY_max
 
int CY_min
 
long long TX_max
 
long long TY_max
 
long long TX_min
 
long long TY_min
 
double branch_default_value_
 
TTree * tree_
 
TTree * tree2_
 
std::map< std::string, double > t_
 
std::map< std::string, double > t2_
 
art::ServiceHandle< art::TFileServicetfs_
 

Detailed Description

Definition at line 61 of file FastMMStudy_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

zcl::FastMMStudy::FastMMStudy ( fhicl::ParameterSet const &  p)
explicit

Definition at line 116 of file FastMMStudy_module.cc.

117  :
118  EDAnalyzer(p),
119  _slicelabel(p.get<std::string>("slice_label")),
120  _sliceinstance(p.get<std::string>("slice_instance")),
121  _xMin(p.get<int>("x_min")),
122  _xMax(p.get<int>("x_max")),
123  _yMin(p.get<int>("y_min")),
124  _yMax(p.get<int>("y_max")),
125  _zMin(p.get<int>("z_min")),
126  _zMax(p.get<int>("z_max")),
127  _deltx(p.get<int>("x_delt")),
128  _delty(p.get<int>("y_delt")),
129  _deltz(p.get<int>("z_delt")),
130  _sigmaP(p.get<int>("sigma_P")),
131  _stdevcellsperplane(p.get<double>("stdev_cells_per_plane")),
132  _MaxHitsPerLength(p.get<double>("max_hits_per_length")),
133  _MaxOffCenter(p.get<double>("max_off_center")),
134  _MinNumberSurfaceHits(p.get<int>("min_number_surface_hits"))
135 {
136 }
std::string _sliceinstance
const char * p
Definition: xmltok.h:285
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
enum BeamMode string
zcl::FastMMStudy::FastMMStudy ( FastMMStudy const &  )
delete
zcl::FastMMStudy::FastMMStudy ( FastMMStudy &&  )
delete

Member Function Documentation

void zcl::FastMMStudy::analyze ( art::Event const &  e)
overridevirtual

I want to remove isolated hits from beginning

Implements art::EDAnalyzer.

Definition at line 139 of file FastMMStudy_module.cc.

References _deltx, _delty, _deltz, _nSatHits, _sigmaP, _slicelabel, _trueHits, _xMax, _xMin, _yMax, _yMin, _zMax, _zMin, rawdata::RawDigit::ADC(), rb::Cluster::AllCells(), sim::ParticleNavigator::begin(), beta_MC, compare_h5_caf::branch, branch_default_value_, rb::CellHit::Cell(), CX_max, CX_min, CY_max, CY_min, Distance(), sim::ParticleNavigator::end(), art::Event::event(), geom(), art::DataViewImpl::getByLabel(), make_syst_table_plots::h, hits(), MECModelEnuComparisons::i, geo::kX, LinFit(), simb::MCParticle::Mass(), std::max(), std::min(), rb::Cluster::NCell(), NumberOfCellsPerLength(), NumberOfHitsInOverlapPlanesCut(), NumberOfSurfaceHits(), nxhits_MC, nyhits_MC, simb::MCParticle::P(), cheat::BackTracker::ParticleNavigator(), cheat::BackTracker::ParticleToFLSHit(), simb::MCParticle::PdgCode(), rb::CellHit::Plane(), PX_max, PX_min, PY_max, PY_min, art::Event::run(), std::sqrt(), StdevCellsPerPlane(), art::Event::subRun(), t_, rawdata::RawDigit::TDC(), tf_MC, ti_MC, simb::MCParticle::TrackId(), tree2_, tree_, tset(), tset2(), TX_max, TX_min, TY_max, TY_min, rb::CellHit::View(), WeightedCenterCut(), and rb::Cluster::XCell().

139  {
140  // std::unique_ptr<std::vector<novaddt::TriggerDecision>>
141  // trigger_decisions(new std::vector<novaddt::TriggerDecision>);
145  e.getByLabel(_slicelabel, slices);
146  //e.getByLabel(_slicelabel, _sliceinstance, slices);
147 
148  //Get MC info first:
150  const sim::ParticleNavigator& pnav = bt->ParticleNavigator();
151  for (sim::ParticleNavigator::const_iterator i = pnav.begin(); i != pnav.end(); ++i) {
152  nxhits_MC = 0;
153  nyhits_MC = 0;
154  const sim::Particle *p = (*i).second;
155  if (p->PdgCode()!=42 ) continue;
156  // std::cout<<"Found monopole mctruth"<<std::endl;
157  const std::vector<sim::FLSHit>& flshits = bt->ParticleToFLSHit(p->TrackId());
158  unsigned ntruehits_Tot = flshits.size();
159  if ( ntruehits_Tot==0 ) continue;
160  // std::cout<<"Monopole mctruth hits more than 0!"<<std::endl;
161  double momentum2 = (p->P())*(p->P());
162  double mass2 = (p->Mass())*(p->Mass());
163  beta_MC = sqrt(momentum2 / (momentum2+mass2) );
164  ti_MC = flshits[0].GetEntryT();
165  tf_MC = flshits[0].GetExitT();
166  size_t planeID_i = flshits[0].GetPlaneID();
167  if (planeID_i%2) ++nxhits_MC;
168  else ++nyhits_MC;
169  for (unsigned h =1; h!= flshits.size(); ++h) {
170  double ti = flshits[h].GetEntryT();
171  double tf = flshits[h].GetExitT();
172  if (ti < ti_MC) {
173  ti_MC = ti;
174  }
175  if (tf > tf_MC) {
176  tf_MC = tf;
177  }
178  if (flshits[h].GetPlaneID() % 2) ++nxhits_MC;
179  else ++nyhits_MC;
180  }
181  tset2("betaMC",beta_MC);
182  tset2("run_number", e.run());
183  tset2("subrun_number", e.subRun());
184  tset2("event_number", e.event());
185  tree2_->Fill();
186  //1 monopole per event, so you can break out from the loop:
187  break;
188  }
189 
190  ///I want to remove isolated hits from beginning
191  // std::cout<<"number of slices you are getting: "<<slices->size()<<std::endl;
192  // std::cout<<"event start time: "<<event_time*15.625<<std::endl;
193  // std::cout<<"TDCT0: "<<TDCT0*15.625<<std::endl;
194  // std::cout<<"ti MC and tf MC: "<<ti_MC<<" "<<tf_MC<<std::endl;
195  for (unsigned i = 0; i!= slices->size(); ++i) {
196  const rb::Cluster& hits = (*slices)[i];
197  PX_max = 0;//P is for plane .enhao
198  CX_max = 0;
199  CY_max = 0;
200  PY_max = 0;
201  PX_min = 99999;
202  CX_min = 99999;
203  CY_min = 99999;
204  PY_min = 99999;
205  TX_max = hits.XCell(0)->TDC();
206  TY_max = TX_max;
207  TX_min = hits.XCell(0)->TDC();
208  TY_min = TX_min;
209  _trueHits = 0;
210  _nSatHits = 0;
211 
212  //int nb_hits = hits.NCell();
213  // std::cout<<"slice number = "<<i+1<<" number of hits: "<<nb_hits<<std::endl;
214  int entry_id = 0;
215  bool PassThrough = false;
216  bool Intrusion = false;
217 
218  int nx = 0;
219  int ny = 0;
220  double sumADC=0;
221  double stdevADC=0;
222  double sq_sum_ADC=0;
223 
224  std::vector<double> x_hit;
225  std::vector<double> y_hit;
226  std::vector<double> zy_hit;
227  std::vector<double> zx_hit;
228  //const double peakToBaselineOffset = 96;
229  for (auto const hit_ptr: hits.AllCells()) {
230  const rb::CellHit hit = *hit_ptr;
231  sumADC+=hit.ADC();
232  sq_sum_ADC+=hit.ADC()*hit.ADC();
233  if (hit.ADC()>3100) ++ _nSatHits;
234 
235  //X view hits
236  if (hit.View()== geo::kX) {
237  //std::cout<<"X hits"<<std::endl;
238  ++nx;
239  x_hit.push_back(hit.Cell());
240  zx_hit.push_back(hit.Plane());
241  if (PX_max < hit.Plane()) PX_max = hit.Plane();
242  if (PX_min > hit.Plane()) PX_min = hit.Plane();
243  if (CX_max < hit.Cell()) CX_max = hit.Cell();
244  if (CX_min > hit.Cell()) CX_min = hit.Cell();
245  if (TX_max < hit.TDC()) TX_max = hit.TDC();
246  if (TX_min > hit.TDC()) TX_min = hit.TDC();
247 
248  if (!Intrusion) {
249  if (hit.Cell() < _xMin+_deltx) {
250  entry_id = 1;
251  Intrusion = true;
252  }
253  else if (hit.Cell()> _xMax-_deltx) {
254  entry_id = 2;
255  Intrusion = true;
256  }
257  }
258  else if (!PassThrough) {
259  if (hit.Cell() < _xMin+_deltx && entry_id != 1) PassThrough = true;
260  else if (hit.Cell()> _xMax-_deltx && entry_id != 2) PassThrough = true;
261  }
262  }
263  //Y view hits
264  else {
265  //std::cout<<"Y hits"<<std::endl;
266  ++ny;
267  y_hit.push_back(hit.Cell());
268  zy_hit.push_back(hit.Plane());
269  if (PY_max < hit.Plane()) PY_max = hit.Plane();
270  if (PY_min > hit.Plane()) PY_min = hit.Plane();
271  if (CY_max < hit.Cell()) CY_max = hit.Cell();
272  if (CY_min > hit.Cell()) CY_min = hit.Cell();
273  if (TY_max < hit.TDC() ) TY_max = hit.TDC();
274  if (TY_min > hit.TDC() ) TY_min = hit.TDC();
275 
276  if (!Intrusion) {
277  if (hit.Cell() < _yMin+_delty) {
278  entry_id = 3;
279  Intrusion = true;
280  }
281  else if (hit.Cell()> _yMax-_delty) {
282  entry_id = 4;
283  Intrusion = true;
284  }
285  }
286  else if (!PassThrough) {
287  if (hit.Cell() < _yMin+_delty && entry_id != 3) PassThrough = true;
288  else if (hit.Cell()> _yMax-_delty && entry_id != 4) PassThrough = true;
289  }
290  }
291  //No matter which view:
292  if (!Intrusion) {
293  if (hit.Plane() < _zMin+_deltz) {
294  entry_id = 5;
295  Intrusion = true;
296  }
297  else if (hit.Plane() > _zMax-_deltz) {
298  entry_id = 6;
299  Intrusion = true;
300  }
301  }
302  else if (!PassThrough) {
303  if (hit.Plane() < _zMin+_deltz && entry_id != 5) PassThrough=true;
304  else if (hit.Plane() > _zMax-_deltz && entry_id != 6) PassThrough=true;
305  }//I think there is a bug if this hit is at corner, it's cell value will set x intrusion true and entry id =1 and then it will pass through if it's plane val is 0 . by enhao
306  }
307 
308  //Min-hits on both view:
309  // std::cout<<"xhits number : "<<nx<<" yhits number : "<<ny<<std::endl;
310  double preselection=0;
311  if (_trueHits>1 || nx<3 || ny<3||!PassThrough||(std::min(PX_max,PY_max) < std::max(PX_min,PY_min)+_sigmaP)||(std::min(TX_max,TY_max) < std::max(TX_min,TY_min))) { //select cosmic I should add a handler in fcl file.
312  continue;
313  }
314  // if (_trueHits<1 || nx<3 || ny<3||!PassThrough||(std::min(PX_max,PY_max) < std::max(PX_min,PY_min)+_sigmaP)||(std::min(TX_max,TY_max) < std::max(TX_min,TY_min))) {//select MC
315  //tset("betaMC",beta_MC);
316  //tset("trueHits",_trueHits);
317  //tset("preselection",preselection);
318  // if(_trueHits>0) {
319  // tree_->Fill();
320  //std::cout<<"event id: "<<e.event()<<" trueHits: "<<_trueHits<<" nx: "<<nx <<" ny: "<< ny<<" Pass Through: "<<PassThrough<<" Pmax: "<<std::min(PX_max,PY_max)<<" Pmin: "<< std::max(PX_min,PY_min)<<" Tmax: "<<std::min(TX_max,TY_max) <<" Tmin:"<< std::max(TX_min,TY_min)<<std::endl;
321  // }
322  //continue;
323  //}
324 
325  //min number of surface hits test:
326  //cut if (NumberOfSurfaceHits(hits)<_MinNumberSurfaceHits) continue;
327  float tracklength =Distance(CX_max, CY_max, PX_max, CX_min, CY_min, PX_min);
328  double tracklength_of_xview=Distance(CX_max, 0, PX_max, CX_min, 0, PX_min);
329  double tracklength_of_yview=Distance(0, CY_max, PY_max, 0, CY_min, PY_min);
330  double number_of_cells_per_length_xview=0;
331  double number_of_cells_per_length_yview=0;
332  NumberOfCellsPerLength(hits,tracklength_of_xview,tracklength_of_yview,number_of_cells_per_length_xview,number_of_cells_per_length_yview);
333  double fitpar[3];
334  LinFit(x_hit, zx_hit, fitpar);
335  double r2x = fitpar[2];
336  LinFit(y_hit, zy_hit, fitpar);
337  double r2y = fitpar[2];
338  //std::cout<<"hits/length is "<<hits.size()/tracklength<<std::endl;
339  //cut if (hits.size()/tracklength>_MaxHitsPerLength) continue;
340  //I didn't add minhitsperlength because there might be noise hits make tracklength too long.
341 
342  //cut if (StdevCellsPerPlane(hits)==false) continue;
343  //cut if(WeightedCenterCut(hits, PX_min, PX_max, PY_min, PY_max, CX_min, CX_max, CY_min, CY_max )==false) continue;
344  // gROOT->SetBatch(kTRUE);
345  stdevADC = std::sqrt( sq_sum_ADC*1.0/(nx+ny) - sumADC*1.0/(nx+ny)*sumADC*1.0/(nx+ny));
346 
347  // Fill Tree
348  preselection=1;
349  for (auto & branch : t_)
350  branch.second = branch_default_value_;
351  double weighted_off_center_xx=0, weighted_off_center_xz=0, weighted_off_center_yy=0, weighted_off_center_yz=0;
352  double stdev_cells_per_plane_xview=0, stdev_cells_per_plane_yview=0;
353  tset("run_number", e.run());
354  tset("subrun_number", e.subRun());
355  tset("event_number", e.event());
356  tset("slice_number",i);
357  // tset("event_length", event_length);
358  tset("number_of_surface_hits",NumberOfSurfaceHits(hits));
359  tset("number_of_hits_per_length",hits.NCell()/tracklength);
360  tset("number_of_cells_per_length_xview",number_of_cells_per_length_xview);
361  tset("number_of_cells_per_length_yview",number_of_cells_per_length_yview);
362  tset("track_length",tracklength);
363  StdevCellsPerPlane(hits, stdev_cells_per_plane_xview, stdev_cells_per_plane_yview);
364  tset("stdev_cells_per_plane_xview",stdev_cells_per_plane_xview);
365  tset("stdev_cells_per_plane_yview",stdev_cells_per_plane_yview);
366  tset("weighted_off_center",WeightedCenterCut(hits, PX_min, PX_max, PY_min, PY_max, CX_min, CX_max, CY_min, CY_max, weighted_off_center_xx, weighted_off_center_xz, weighted_off_center_yy, weighted_off_center_yz ));
367  tset("weighted_off_center_xx",weighted_off_center_xx);
368  tset("weighted_off_center_xz",weighted_off_center_xz);
369  tset("weighted_off_center_yy",weighted_off_center_yy);
370  tset("weighted_off_center_yz",weighted_off_center_yz);
371  tset("meanADC",sumADC*1.0/(nx+ny));
372  tset("stdevADC",stdevADC);
373  tset("nxhits",nx);
374  tset("nyhits",ny);
375  tset("percent_of_hits_in_overlap_planes",NumberOfHitsInOverlapPlanesCut(hits,PX_min,PX_max,PY_min,PY_max));
376  tset("trueHits",_trueHits);
377  tset("betaMC",beta_MC);
378  tset("xhitsMC",nxhits_MC);
379  tset("yhitsMC",nyhits_MC);
380  tset("deltaTDC",std::min(TX_max,TY_max) - std::max(TX_min,TY_min));
382  tset("preselection",preselection);
383  tset("nSatHits",_nSatHits);
384  tset("r2x",r2x);
385  tset("r2y",r2y);
386  tset("dPX",PX_max-PX_min+1);
387  tset("dPY",PY_max-PY_min+1);
388  tset("dCX",CX_max-CX_min+1);
389  tset("dCY",CY_max-CY_min+1);
390  // std::cout<<"event id: "<<e.event()<<" trueHits: "<<_trueHits<<" nx: "<<nx <<" ny: "<< ny<<" Pass Through: "<<PassThrough<<" Pmax: "<<std::min(PX_max,PY_max)<<" Pmin: "<< std::max(PX_min,PY_min)<<" Tmax: "<<std::min(TX_max,TY_max) <<" Tmin:"<< std::max(TX_min,TY_min)<<std::endl;
391  tree_->Fill();
392  //if(_trueHits>0) {
393  // tree_->Fill();
394  //}
395  }
396 }
std::map< std::string, double > t_
void StdevCellsPerPlane(rb::Cluster const &hits, double &stdev_cells_per_plane_xview, double &stdev_cells_per_plane_yview) const
T max(const caf::Proxy< T > &a, T b)
int PdgCode() const
Definition: MCParticle.h:211
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
art::Ptr< rb::CellHit > XCell(unsigned int xIdx) const
Get the ith cell in the x-view.
Definition: Cluster.cxx:157
int32_t TDC() const
The time of the last baseline sample.
Definition: RawDigit.h:94
const sim::ParticleNavigator & ParticleNavigator() const
Get a reference to the ParticleNavigator.
Definition: BackTracker.h:744
void LinFit(const std::vector< double > &x, const std::vector< double > &y, double *fitpar)
unsigned short Plane() const
Definition: CellHit.h:39
geo::View_t View() const
Definition: CellHit.h:41
const char * p
Definition: xmltok.h:285
T sqrt(T number)
Definition: d0nt_math.hpp:156
std::vector< sim::FLSHit > ParticleToFLSHit(const int &trackID) const
All the FLSHits that were created by the track id trackID, sorted from most to least light...
double Mass() const
Definition: MCParticle.h:238
list_type::const_iterator const_iterator
Vertical planes which measure X.
Definition: PlaneGeo.h:28
void tset(std::string const &branch_name, double const &value)
A collection of associated CellHits.
Definition: Cluster.h:47
double WeightedCenterCut(rb::Cluster const &hits, float PX_min, float PX_max, float PY_min, float PY_max, float CX_min, float CX_max, float CY_min, float CY_max, double &weighted_off_center_xx, double &weighted_off_center_xz, double &weighted_off_center_yy, double &weighted_off_center_yz) const
double NumberOfHitsInOverlapPlanesCut(rb::Cluster const &hits, float PX_min, float PX_max, float PY_min, float PY_max) const
Timing fit.
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
Definition: Cluster.cxx:180
int TrackId() const
Definition: MCParticle.h:209
unsigned short Cell() const
Definition: CellHit.h:40
CDPStorage service.
void hits()
Definition: readHits.C:15
double P(const int i=0) const
Definition: MCParticle.h:233
void NumberOfCellsPerLength(rb::Cluster const &hits, double tracklength_of_xview, double tracklength_of_yview, double &number_of_cells_per_length_xview, double &number_of_cells_per_length_yview) const
int NumberOfSurfaceHits(rb::Cluster const &hits) const
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
int16_t ADC(uint32_t i) const
Definition: RawDigit.cxx:58
void tset2(std::string const &branch_name, double const &value)
Definition: structs.h:12
void geom(int which=0)
Definition: geom.C:163
T min(const caf::Proxy< T > &a, T b)
float Distance(unsigned const &xcell1, unsigned const &ycell1, unsigned const &plane1, unsigned const &xcell2, unsigned const &ycell2, unsigned const &plane2) const
Float_t e
Definition: plot.C:35
void zcl::FastMMStudy::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 398 of file FastMMStudy_module.cc.

References art::TFileDirectory::make(), t2_, t_, tfs_, tree2_, and tree_.

399 {
400  tree_ = tfs_->make<TTree>("Event", "Monopole Event Tree");
401  tree2_ = tfs_->make<TTree>("MC", "Monopole MC Tree");
402  std::vector<std::string> branch_names =
403  { "run_number", "subrun_number", "event_number", "slice_number","number_of_hits_per_length","number_of_cells_per_length_xview","number_of_cells_per_length_yview","track_length","stdev_cells_per_plane_xview","stdev_cells_per_plane_yview", "weighted_off_center", "weighted_off_center_xx", "weighted_off_center_xz", "weighted_off_center_yy", "weighted_off_center_yz", "percent_of_hits_in_overlap_planes","number_of_surface_hits","betaMC","xhitsMC","yhitsMC","trueHits","preselection","meanADC","stdevADC","nxhits","nyhits","deltaTDC","deltaP","nSatHits","r2x","r2y","dPX","dPY","dCX","dCY"};
404  for (auto const& name : branch_names)
405  tree_->Branch(name.c_str(), &t_[name], (name + "/D").c_str());
406 
407  std::vector<std::string> branch_names2 =
408  { "run_number", "subrun_number", "event_number", "betaMC"};
409  for (auto const& name : branch_names2)
410  tree2_->Branch(name.c_str(), &t2_[name], (name + "/D").c_str());
411 }
std::map< std::string, double > t_
const XML_Char * name
Definition: expat.h:151
art::ServiceHandle< art::TFileService > tfs_
T * make(ARGS...args) const
std::map< std::string, double > t2_
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
float zcl::FastMMStudy::Distance ( unsigned const &  xcell1,
unsigned const &  ycell1,
unsigned const &  plane1,
unsigned const &  xcell2,
unsigned const &  ycell2,
unsigned const &  plane2 
) const
private

Definition at line 537 of file FastMMStudy_module.cc.

References std::sqrt().

Referenced by analyze().

537  {
538  return std::sqrt((plane1-plane2)*(plane1-plane2)*2.82072+(xcell1-xcell2)*(xcell1-xcell2)+(ycell1-ycell2)*(ycell1-ycell2));
539  //This part I should use Martin's smt::Constant::cell width, plane width
540 }
T sqrt(T number)
Definition: d0nt_math.hpp:156
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
int zcl::FastMMStudy::GetSurfaceId ( rb::CellHit const &  hit) const
private

Definition at line 553 of file FastMMStudy_module.cc.

References _deltx, _delty, _deltz, _xMax, _xMin, _yMax, _yMin, _zMax, _zMin, rb::CellHit::Cell(), geo::kX, rb::CellHit::Plane(), and rb::CellHit::View().

553  {
554  int entry_id=0;
555  if (hit.View() == geo::kX) {
556  if (hit.Cell() < _xMin+_deltx) {
557  entry_id = 1;
558  }
559  else if (hit.Cell()> _xMax-_deltx) {
560  entry_id = 2;
561  }
562  }
563  //Y view hits
564  else {
565  if (hit.Cell() < _yMin+_delty) {
566  entry_id = 3;
567  }
568  else if (hit.Cell()> _yMax-_delty) {
569  entry_id = 4;
570  }
571  }
572  //No matter which view:
573  if (hit.Plane() < _zMin+_deltz) {
574  entry_id = 5;
575  }
576  else if (hit.Plane() > _zMax-_deltz) {
577  entry_id = 6;
578  }
579  return entry_id;
580 
581 }
Vertical planes which measure X.
Definition: PlaneGeo.h:28
Definition: structs.h:12
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
void zcl::FastMMStudy::LinFit ( const std::vector< double > &  x,
const std::vector< double > &  y,
double *  fitpar 
)
private

Definition at line 632 of file FastMMStudy_module.cc.

References a, b, DEFINE_ART_MODULE(), getGoodRuns4SAM::n, r(), std::sqrt(), submit_syst::x, xx, and submit_syst::y.

Referenced by analyze().

632  {
633  // http://en.wikipedia.org/wiki/Simple_linear_regression
634  const auto n = x_val.size();
635  const auto x = (std::accumulate(x_val.begin(), x_val.end(), 0.0))/n; // <x>
636  const auto y = (std::accumulate(y_val.begin(), y_val.end(), 0.0))/n; // <y>
637  const auto xx = (std::inner_product(x_val.begin(), x_val.end(), x_val.begin(), 0.0))/n; // <xx>
638  const auto yy = (std::inner_product(y_val.begin(), y_val.end(), y_val.begin(), 0.0))/n; // <yy>
639  const auto xy = (std::inner_product(x_val.begin(), x_val.end(), y_val.begin(), 0.0))/n; // <xy>
640 
641  const auto b = (xy - x*y)/(xx - x*x); // slope
642  const auto a = y - b*x; // intercept
643  const auto r = (xy - x*y)/sqrt((xx - x*x)*(yy - y*y)); // Rxy - coeffcient of determination
644  fitpar[0] = a;
645  fitpar[1] = b;
646  fitpar[2] = r*r;
647 
648 }
Double_t xx
Definition: macro.C:12
T sqrt(T number)
Definition: d0nt_math.hpp:156
const double a
const hit & b
Definition: hits.cxx:21
TRandom3 r(0)
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 zcl::FastMMStudy::NumberOfCellsPerLength ( rb::Cluster const &  hits,
double  tracklength_of_xview,
double  tracklength_of_yview,
double &  number_of_cells_per_length_xview,
double &  number_of_cells_per_length_yview 
) const
private

Definition at line 438 of file FastMMStudy_module.cc.

References rb::Cluster::AllCells(), rb::CellHit::Cell(), distance(), febshutoff_auto::end, MECModelEnuComparisons::i, it, geo::kX, geo::kY, rb::CellHit::Plane(), PX_max, PX_min, PY_max, PY_min, and rb::CellHit::View().

Referenced by analyze().

438  {
439  //Maybe use hits instead of cells?
440  std::vector<std::vector<int>> x_hits_plane(PX_max-PX_min+1,std::vector<int>(0));
441  std::vector<std::vector<int>> y_hits_plane(PY_max-PY_min+1,std::vector<int>(0));
442  for (auto const hit_ptr: hits.AllCells()) {
443  const rb::CellHit hit = *hit_ptr;
444  if (hit.View() == geo::kX) {
445  //std::cout<<"X hits"<<std::endl;
446  x_hits_plane[hit.Plane()-PX_min].push_back(hit.Cell());
447  }
448  if (hit.View() == geo::kY) {
449  //std::cout<<"Y hits"<<std::endl;
450  y_hits_plane[hit.Plane()-PY_min].push_back(hit.Cell());
451  }
452  }
453  //following is to get unique number of cells hit per plane
454  std::vector<int> x_cells_plane(PX_max-PX_min+1,0);
455  std::vector<int> y_cells_plane(PY_max-PY_min+1,0);
456  for (unsigned i=0;i!=x_hits_plane.size();i++){
457  std::sort(x_hits_plane[i].begin(),x_hits_plane[i].end());
458  std::vector<int>::iterator it;
459  it = std::unique (x_hits_plane[i].begin(),x_hits_plane[i].end());
460  x_hits_plane[i].resize(std::distance(x_hits_plane[i].begin(),it));
461  x_cells_plane[i]=x_hits_plane[i].size();
462  }
463  for (unsigned i=0;i!=y_hits_plane.size();i++){
464  std::sort(y_hits_plane[i].begin(),y_hits_plane[i].end());
465  std::vector<int>::iterator it;
466  it = std::unique (y_hits_plane[i].begin(),y_hits_plane[i].end());
467  y_hits_plane[i].resize(std::distance(y_hits_plane[i].begin(),it));
468  y_cells_plane[i]=y_hits_plane[i].size();
469  }
470  //following is to get number of cells per track length in x view and y view
471  int sum_of_cells=0;
472  for (unsigned i=0;i!=x_cells_plane.size();i++){
473  sum_of_cells+=x_cells_plane[i];
474  }
475  number_of_cells_per_length_xview=sum_of_cells/tracklength_of_xview;
476  sum_of_cells=0;
477  for (unsigned i=0;i!=y_cells_plane.size();i++){
478  sum_of_cells+=y_cells_plane[i];
479  }
480  number_of_cells_per_length_yview=sum_of_cells/tracklength_of_yview;
481 
482 }
set< int >::iterator it
unsigned short Plane() const
Definition: CellHit.h:39
geo::View_t View() const
Definition: CellHit.h:41
Vertical planes which measure X.
Definition: PlaneGeo.h:28
unsigned distance(const T &t1, const T &t2)
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
unsigned short Cell() const
Definition: CellHit.h:40
void hits()
Definition: readHits.C:15
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
Definition: structs.h:12
double zcl::FastMMStudy::NumberOfHitsInOverlapPlanesCut ( rb::Cluster const &  hits,
float  PX_min,
float  PX_max,
float  PY_min,
float  PY_max 
) const
private

Definition at line 619 of file FastMMStudy_module.cc.

References rb::Cluster::AllCells(), cet::sqlite::max(), std::max(), min(), std::min(), rb::Cluster::NCell(), and rb::CellHit::Plane().

Referenced by analyze().

619  {
620  int max=std::min(PX_max,PY_max);
621  int min=std::max(PX_min,PY_min);
622  double number_hits_in_overlap_planes=0;
623  for (auto const hit_ptr: hits.AllCells()) {
624  const rb::CellHit hit = *hit_ptr;
625  if(hit.Plane()<=max && hit.Plane()>=min) number_hits_in_overlap_planes++;
626  }
627 
628  return number_hits_in_overlap_planes/hits.NCell();
629 
630 }
T max(const caf::Proxy< T > &a, T b)
unsigned short Plane() const
Definition: CellHit.h:39
void hits()
Definition: readHits.C:15
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
Definition: structs.h:12
T min(const caf::Proxy< T > &a, T b)
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
int zcl::FastMMStudy::NumberOfSurfaceHits ( rb::Cluster const &  hits) const
private

Definition at line 583 of file FastMMStudy_module.cc.

References rb::Cluster::Cell(), MECModelEnuComparisons::i, rb::Cluster::NCell(), and SurfAssign().

Referenced by analyze().

583  {
584  int number_of_surface_hits=0;
585  for(unsigned i=0;i!=hits.NCell();++i){
586  if(SurfAssign(*(hits.Cell(i)))==true) number_of_surface_hits++;
587  }
588  return number_of_surface_hits;
589 }
bool SurfAssign(rb::CellHit const &hit) const
void hits()
Definition: readHits.C:15
FastMMStudy& zcl::FastMMStudy::operator= ( FastMMStudy const &  )
delete
FastMMStudy& zcl::FastMMStudy::operator= ( FastMMStudy &&  )
delete
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 zcl::FastMMStudy::StdevCellsPerPlane ( rb::Cluster const &  hits,
double &  stdev_cells_per_plane_xview,
double &  stdev_cells_per_plane_yview 
) const
private

Definition at line 483 of file FastMMStudy_module.cc.

References rb::Cluster::AllCells(), rb::CellHit::Cell(), distance(), febshutoff_auto::end, MECModelEnuComparisons::i, it, geo::kX, geo::kY, extractScale::mean, rb::CellHit::Plane(), PX_max, PX_min, PY_max, PY_min, std::sqrt(), HandyFuncs::stdev(), sum, and rb::CellHit::View().

Referenced by analyze().

483  {
484  //fluctuation of number of cells of each plane check by Enhao
485  //I need to use cells not hits, because there might be many hits in same cell, and the cosmic shower has many different cells hits
486  //Maybe use hits instead of cells?
487  std::vector<std::vector<int>> x_hits_plane(PX_max-PX_min+1,std::vector<int>(0));
488  std::vector<std::vector<int>> y_hits_plane(PY_max-PY_min+1,std::vector<int>(0));
489  for (auto const hit_ptr: hits.AllCells()) {
490  const rb::CellHit hit = *hit_ptr;
491  if (hit.View() == geo::kX) {
492  //std::cout<<"X hits"<<std::endl;
493  x_hits_plane[hit.Plane()-PX_min].push_back(hit.Cell());
494  }
495  if (hit.View() == geo::kY) {
496  //std::cout<<"Y hits"<<std::endl;
497  y_hits_plane[hit.Plane()-PY_min].push_back(hit.Cell());
498  }
499  }
500  double sum =0;
501  double mean = 0;
502  double sq_sum = 0;
503  double stdev = 0;
504  //following is to get unique number of cells hit per plane
505  std::vector<int> x_cells_plane(PX_max-PX_min+1,0);
506  std::vector<int> y_cells_plane(PY_max-PY_min+1,0);
507  for (unsigned i=0;i!=x_hits_plane.size();i++){
508  std::sort(x_hits_plane[i].begin(),x_hits_plane[i].end());
509  std::vector<int>::iterator it;
510  it = std::unique (x_hits_plane[i].begin(),x_hits_plane[i].end());
511  x_hits_plane[i].resize(std::distance(x_hits_plane[i].begin(),it));
512  x_cells_plane[i]=x_hits_plane[i].size();
513  }
514  for (unsigned i=0;i!=y_hits_plane.size();i++){
515  std::sort(y_hits_plane[i].begin(),y_hits_plane[i].end());
516  std::vector<int>::iterator it;
517  it = std::unique (y_hits_plane[i].begin(),y_hits_plane[i].end());
518  y_hits_plane[i].resize(std::distance(y_hits_plane[i].begin(),it));
519  y_cells_plane[i]=y_hits_plane[i].size();
520  }
521  sum = std::accumulate(x_cells_plane.begin(),x_cells_plane.end(),0.0);
522  mean = sum / x_cells_plane.size();
523  sq_sum = std::inner_product(x_cells_plane.begin(),x_cells_plane.end(),x_cells_plane.begin(),0.0);
524  stdev = std::sqrt(sq_sum / x_cells_plane.size()-mean * mean);
525  // std::cout<<"x stdev is "<<stdev<<" "<<stdev/mean<<std::endl;
526  //if (stdev/mean > _stdevcellsperplane) return false;
527  stdev_cells_per_plane_xview=stdev/mean;
528  sum = std::accumulate(y_cells_plane.begin(),y_cells_plane.end(),0.0);
529  mean = sum / y_cells_plane.size();
530  sq_sum = std::inner_product(y_cells_plane.begin(),y_cells_plane.end(),y_cells_plane.begin(),0.0);
531  stdev = std::sqrt(sq_sum / y_cells_plane.size()-mean * mean);
532  stdev_cells_per_plane_yview=stdev/mean;
533  // std::cout<<"y stdev is "<<stdev<<" "<<stdev/mean<<std::endl;
534  // std::cout<<"sum of x and y stdev is "<<sum_stdev<<std::endl;
535  //if (stdev/mean > _stdevcellsperplane) return false;
536 }
def stdev(lst)
Definition: HandyFuncs.py:286
set< int >::iterator it
unsigned short Plane() const
Definition: CellHit.h:39
geo::View_t View() const
Definition: CellHit.h:41
T sqrt(T number)
Definition: d0nt_math.hpp:156
Vertical planes which measure X.
Definition: PlaneGeo.h:28
unsigned distance(const T &t1, const T &t2)
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
unsigned short Cell() const
Definition: CellHit.h:40
void hits()
Definition: readHits.C:15
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
Definition: structs.h:12
Double_t sum
Definition: plot.C:31
bool zcl::FastMMStudy::SurfAssign ( rb::CellHit const &  hit) const
private

Definition at line 542 of file FastMMStudy_module.cc.

References _deltx, _deltz, _xMax, _xMin, _zMax, _zMin, rb::CellHit::Cell(), and rb::CellHit::Plane().

Referenced by NumberOfSurfaceHits().

542  {
543  //Check if this is close to surface
544  if ( hit.Cell() > _xMax - _deltx ) return true;
545  else if ( hit.Cell() < _xMin+_deltx ) return true;
546  else if ( hit.Plane() < _zMin+_deltz ) return true;
547  else if ( hit.Plane() > _zMax - _deltz ) return true;
548 
549  return false;
550 }
Definition: structs.h:12
void zcl::FastMMStudy::tset ( std::string const &  branch_name,
double const &  value 
)
private

Definition at line 413 of file FastMMStudy_module.cc.

References ana::assert(), om::cerr, allTimeWatchdog::endl, it, and t_.

Referenced by analyze().

414 {
415  auto it = t_.find(branch_name);
416  if (it == t_.end())
417  {
418  std::cerr << "\n\t Branch " << branch_name << " does not exist! \n"
419  << std::endl;
420  assert(false);
421  }
422 
423  it->second = value;
424 }
std::map< std::string, double > t_
set< int >::iterator it
OStream cerr
Definition: OStream.cxx:7
const XML_Char int const XML_Char * value
Definition: expat.h:331
assert(nhit_max >=nhit_nbins)
void zcl::FastMMStudy::tset2 ( std::string const &  branch_name,
double const &  value 
)
private

Definition at line 426 of file FastMMStudy_module.cc.

References ana::assert(), om::cerr, allTimeWatchdog::endl, it, and t2_.

Referenced by analyze().

427 {
428  auto it = t2_.find(branch_name);
429  if (it == t2_.end())
430  {
431  std::cerr << "\n\t Branch " << branch_name << " does not exist! \n"
432  << std::endl;
433  assert(false);
434  }
435 
436  it->second = value;
437 }
set< int >::iterator it
OStream cerr
Definition: OStream.cxx:7
const XML_Char int const XML_Char * value
Definition: expat.h:331
assert(nhit_max >=nhit_nbins)
std::map< std::string, double > t2_
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 &)
double zcl::FastMMStudy::WeightedCenterCut ( rb::Cluster const &  hits,
float  PX_min,
float  PX_max,
float  PY_min,
float  PY_max,
float  CX_min,
float  CX_max,
float  CY_min,
float  CY_max,
double &  weighted_off_center_xx,
double &  weighted_off_center_xz,
double &  weighted_off_center_yy,
double &  weighted_off_center_yz 
) const
private

Definition at line 590 of file FastMMStudy_module.cc.

References std::abs(), rawdata::RawDigit::ADC(), rb::Cluster::AllCells(), rb::CellHit::Cell(), CX_min, CY_min, geo::kX, geo::kY, std::max(), rb::CellHit::Plane(), PX_min, PY_min, and rb::CellHit::View().

Referenced by analyze().

590  {
591  float Weighted_PX_Center=0.5,Weighted_CX_Center=0.5,Weighted_PY_Center=0.5,Weighted_CY_Center=0.5,SumOfXHitsADC=0,SumOfYHitsADC=0;
592  for (auto const hit_ptr: hits.AllCells()) {
593  const rb::CellHit hit = *hit_ptr;
594  if (hit.View() == geo::kX) {
595  SumOfXHitsADC+=hit.ADC();
596  Weighted_PX_Center+=hit.ADC()*(hit.Plane()-PX_min);
597  Weighted_CX_Center+=hit.ADC()*(hit.Cell()-CX_min);
598  }
599  if (hit.View() == geo::kY) {
600  SumOfYHitsADC+=hit.ADC();
601  Weighted_PY_Center+=hit.ADC()*(hit.Plane()-PY_min);
602  Weighted_CY_Center+=hit.ADC()*(hit.Cell()-CY_min);
603  }
604  }
605  if(PX_max!=PX_min) Weighted_PX_Center=Weighted_PX_Center/SumOfXHitsADC/(PX_max-PX_min);
606  if(PY_max!=PY_min) Weighted_PY_Center=Weighted_PY_Center/SumOfYHitsADC/(PY_max-PY_min);
607  if(CX_max!=CX_min) Weighted_CX_Center=Weighted_CX_Center/SumOfXHitsADC/(CX_max-CX_min);
608  if(CY_max!=CY_min) Weighted_CY_Center=Weighted_CY_Center/SumOfYHitsADC/(CY_max-CY_min);
609  // std::cout<<"weighted px, py, cx, cy center is "<<Weighted_PX_Center<<" "<<Weighted_PY_Center<<" "<<Weighted_CX_Center<<" "<<Weighted_CY_Center<<std::endl;
610  // if(std::abs(Weighted_PX_Center-0.5)>_MaxOffCenter||std::abs(Weighted_PY_Center-0.5)>_MaxOffCenter||std::abs(Weighted_CX_Center-0.5)>_MaxOffCenter||std::abs(Weighted_CY_Center-0.5)>_MaxOffCenter) return false;
611  //else return true;
612  weighted_off_center_xx=std::abs(Weighted_CX_Center-0.5);
613  weighted_off_center_xz=std::abs(Weighted_PX_Center-0.5);
614  weighted_off_center_yy=std::abs(Weighted_CY_Center-0.5);
615  weighted_off_center_yz=std::abs(Weighted_PY_Center-0.5);
616  return std::max(std::max(std::abs(Weighted_PX_Center-0.5),std::abs(Weighted_PY_Center-0.5)),std::max(std::abs(Weighted_CX_Center-0.5),std::abs(Weighted_CY_Center-0.5)));
617 }
T max(const caf::Proxy< T > &a, T b)
unsigned short Plane() const
Definition: CellHit.h:39
geo::View_t View() const
Definition: CellHit.h:41
Vertical planes which measure X.
Definition: PlaneGeo.h:28
float abs(float number)
Definition: d0nt_math.hpp:39
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
unsigned short Cell() const
Definition: CellHit.h:40
void hits()
Definition: readHits.C:15
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
int16_t ADC(uint32_t i) const
Definition: RawDigit.cxx:58
Definition: structs.h:12
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 zcl::FastMMStudy::_deltx
private

Definition at line 85 of file FastMMStudy_module.cc.

Referenced by analyze(), GetSurfaceId(), and SurfAssign().

int zcl::FastMMStudy::_delty
private

Definition at line 86 of file FastMMStudy_module.cc.

Referenced by analyze(), and GetSurfaceId().

int zcl::FastMMStudy::_deltz
private

Definition at line 87 of file FastMMStudy_module.cc.

Referenced by analyze(), GetSurfaceId(), and SurfAssign().

double zcl::FastMMStudy::_MaxHitsPerLength
private

Definition at line 92 of file FastMMStudy_module.cc.

double zcl::FastMMStudy::_MaxOffCenter
private

Definition at line 93 of file FastMMStudy_module.cc.

int zcl::FastMMStudy::_MinNumberSurfaceHits
private

Definition at line 94 of file FastMMStudy_module.cc.

int zcl::FastMMStudy::_nSatHits
private

Definition at line 90 of file FastMMStudy_module.cc.

Referenced by analyze().

int zcl::FastMMStudy::_sigmaP
private

Definition at line 88 of file FastMMStudy_module.cc.

Referenced by analyze().

std::string zcl::FastMMStudy::_sliceinstance
private

Definition at line 73 of file FastMMStudy_module.cc.

std::string zcl::FastMMStudy::_slicelabel
private

Definition at line 72 of file FastMMStudy_module.cc.

Referenced by analyze().

double zcl::FastMMStudy::_stdevcellsperplane
private

Definition at line 91 of file FastMMStudy_module.cc.

int zcl::FastMMStudy::_trueHits
private

Definition at line 89 of file FastMMStudy_module.cc.

Referenced by analyze().

int zcl::FastMMStudy::_xMax
private

Definition at line 80 of file FastMMStudy_module.cc.

Referenced by analyze(), GetSurfaceId(), and SurfAssign().

int zcl::FastMMStudy::_xMin
private

Definition at line 79 of file FastMMStudy_module.cc.

Referenced by analyze(), GetSurfaceId(), and SurfAssign().

int zcl::FastMMStudy::_yMax
private

Definition at line 82 of file FastMMStudy_module.cc.

Referenced by analyze(), and GetSurfaceId().

int zcl::FastMMStudy::_yMin
private

Definition at line 81 of file FastMMStudy_module.cc.

Referenced by analyze(), and GetSurfaceId().

int zcl::FastMMStudy::_zMax
private

Definition at line 84 of file FastMMStudy_module.cc.

Referenced by analyze(), GetSurfaceId(), and SurfAssign().

int zcl::FastMMStudy::_zMin
private

Definition at line 83 of file FastMMStudy_module.cc.

Referenced by analyze(), GetSurfaceId(), and SurfAssign().

double zcl::FastMMStudy::beta_MC
private

Definition at line 77 of file FastMMStudy_module.cc.

Referenced by analyze().

double zcl::FastMMStudy::branch_default_value_
private

Definition at line 97 of file FastMMStudy_module.cc.

Referenced by analyze().

int zcl::FastMMStudy::CX_max
private

Definition at line 95 of file FastMMStudy_module.cc.

Referenced by analyze().

int zcl::FastMMStudy::CX_min
private

Definition at line 95 of file FastMMStudy_module.cc.

Referenced by analyze(), and WeightedCenterCut().

int zcl::FastMMStudy::CY_max
private

Definition at line 95 of file FastMMStudy_module.cc.

Referenced by analyze().

int zcl::FastMMStudy::CY_min
private

Definition at line 95 of file FastMMStudy_module.cc.

Referenced by analyze(), and WeightedCenterCut().

int zcl::FastMMStudy::nxhits_MC
private

Definition at line 75 of file FastMMStudy_module.cc.

Referenced by analyze().

int zcl::FastMMStudy::nyhits_MC
private

Definition at line 75 of file FastMMStudy_module.cc.

Referenced by analyze().

int zcl::FastMMStudy::PX_max
private

Definition at line 95 of file FastMMStudy_module.cc.

Referenced by analyze(), NumberOfCellsPerLength(), and StdevCellsPerPlane().

int zcl::FastMMStudy::PX_min
private
int zcl::FastMMStudy::PY_max
private

Definition at line 95 of file FastMMStudy_module.cc.

Referenced by analyze(), NumberOfCellsPerLength(), and StdevCellsPerPlane().

int zcl::FastMMStudy::PY_min
private
std::map<std::string, double> zcl::FastMMStudy::t2_
private

Definition at line 101 of file FastMMStudy_module.cc.

Referenced by beginJob(), and tset2().

std::map<std::string, double> zcl::FastMMStudy::t_
private

Definition at line 100 of file FastMMStudy_module.cc.

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

double zcl::FastMMStudy::tf_MC
private

Definition at line 76 of file FastMMStudy_module.cc.

Referenced by analyze().

art::ServiceHandle<art::TFileService> zcl::FastMMStudy::tfs_
private

Definition at line 102 of file FastMMStudy_module.cc.

Referenced by beginJob().

double zcl::FastMMStudy::ti_MC
private

Definition at line 76 of file FastMMStudy_module.cc.

Referenced by analyze().

TTree* zcl::FastMMStudy::tree2_
private

Definition at line 99 of file FastMMStudy_module.cc.

Referenced by analyze(), and beginJob().

TTree* zcl::FastMMStudy::tree_
private

Definition at line 98 of file FastMMStudy_module.cc.

Referenced by analyze(), and beginJob().

long long zcl::FastMMStudy::TX_max
private

Definition at line 96 of file FastMMStudy_module.cc.

Referenced by analyze().

long long zcl::FastMMStudy::TX_min
private

Definition at line 96 of file FastMMStudy_module.cc.

Referenced by analyze().

long long zcl::FastMMStudy::TY_max
private

Definition at line 96 of file FastMMStudy_module.cc.

Referenced by analyze().

long long zcl::FastMMStudy::TY_min
private

Definition at line 96 of file FastMMStudy_module.cc.

Referenced by analyze().


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