Classes | Functions
clusterInfo.h File Reference
#include <TMath.h>

Go to the source code of this file.

Classes

class  clusterInfo
 

Functions

clusterInfo CalcCluster (const novaddt::HitList &slice)
 
std::ostream & operator<< (std::ostream &s, const clusterInfo &c)
 

Function Documentation

clusterInfo CalcCluster ( const novaddt::HitList slice)

Definition at line 26 of file clusterInfo.h.

References clusterInfo::adc, clusterInfo::adc_corr, plot_validation_datamc::c, clusterInfo::crd, stan::math::exp(), clusterInfo::n, elec2geo::pos, clusterInfo::t, and POTSpillRate::view.

Referenced by supernova::sliceAna::analyze(), novaddt::SliceSelector::checkSlice(), and novaddt::SupernovaTrigger::GetCandidates().

26  {
27  clusterInfo c;
28  //get the minimal time
29  c.t=slice.front().TDC().val;
30  c.crd[2] = slice.front().Plane().val;
31 
32  for(auto const& hit : slice){
33 
34  const uint16_t view = hit.View().val-1;
35  if(c.n[view] == 0) c.crd[view] = hit.Cell().val;
36 
37  ++c.n[view];
38  }
39 
40  for(auto const& hit : slice){
41  // View of *this* cell
42  const uint16_t view = hit.View().val-1;
43 
44  // coordinate of the *other* view, or halfway if
45  const double pos = c.n[!view]?c.crd[!view]:384./2.;
46 
47  const double atten_len = 400./3.93; // in *cells*
48 
49  c.adc[view] += hit.ADC().val;
50  c.adc_corr += hit.ADC().val
51  *exp((384.-pos )/atten_len)
52  /exp((384./ 2. )/atten_len);
53  }
54  return c;
55 
56 }
uint64_t n[2]
Definition: clusterInfo.h:20
double adc_corr
Definition: clusterInfo.h:22
uint64_t t
Definition: clusterInfo.h:18
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:10
Definition: structs.h:12
uint64_t adc[2]
Definition: clusterInfo.h:21
uint64_t crd[3]
Definition: clusterInfo.h:19
std::ostream& operator<< ( std::ostream &  s,
const clusterInfo c 
)

Definition at line 58 of file clusterInfo.h.

References clusterInfo::ADC(), clusterInfo::crd, clusterInfo::n, and clusterInfo::t.

58  {
59  //s<<"adc="<<(int)c.ADC()<<" n=["<<c.n[0]<<","<<c.n[1]<<"]; pos=["<<c.crd[0]<<","<<c.crd[1]<<","<<c.crd[2]<<","<<c.t<<"]";
60  s<<c.ADC()<<" "<<c.n[0]<<" "<<c.n[1]<<" "<<c.crd[0]<<" "<<c.crd[1]<<" "<<c.crd[2]<<" "<<c.t;
61  return s;
62 }
uint64_t n[2]
Definition: clusterInfo.h:20
const XML_Char * s
Definition: expat.h:262
uint64_t ADC() const
Definition: clusterInfo.h:10
uint64_t t
Definition: clusterInfo.h:18
uint64_t crd[3]
Definition: clusterInfo.h:19