CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripClusterTools.h
Go to the documentation of this file.
1 #ifndef DataFormatsSiStripClusterSiStripClusterTools_H
2 #define DataFormatsSiStripClusterSiStripClusterTools_H
3 
6 
7 #include<numeric>
8 
9 namespace siStripClusterTools {
10 
11  // to be moved and optimized in TrackerCommon when TrackerTopology will support moduleGeometry
13  {
14  if (detid.subdetId()>=SiStripDetId::TIB) {
15  SiStripDetId siStripDetId = detid();
16  if (siStripDetId.subdetId()==SiStripDetId::TOB) return 1.f/0.047f;
17  if (siStripDetId.moduleGeometry()==SiStripDetId::W5 || siStripDetId.moduleGeometry()==SiStripDetId::W6 ||
18  siStripDetId.moduleGeometry()==SiStripDetId::W7)
19  return 1.f/0.047f;
20  return 1.f/0.029f; // so it is TEC ring 1-4 or TIB or TOB;
21  } else if (detid.subdetId()==1) return 1.f/0.0285f;
22  else return 1.f/0.027f;
23  }
24 
25  template<typename Iter>
26  float chargePerCM(DetId detid, Iter a, Iter b) {
27  return float(std::accumulate(a,b,int(0)))*sensorThicknessInverse(detid);
28  }
29 
30  template<typename Clus>
31  float chargePerCM(DetId detid, Clus const & cl) {
32  return cl.charge()*sensorThicknessInverse(detid);
33  }
34 
35 
36  template<typename Clus>
37  float chargePerCM(DetId detid, Clus const & cl, LocalTrajectoryParameters const & tp) {
38  return chargePerCM(detid,cl)*tp.absdz();
39  }
40 
41  template<typename Clus>
42  float chargePerCM(DetId detid, Clus const & cl, const LocalVector & ldir) {
43  return chargePerCM(detid,cl)*std::abs(ldir.z())/ldir.mag();
44  }
45 
46 
47 
48 }
49 
50 
51 #endif // DataFormatsSiStripClusterSiStripClusterTools_H
52 
float chargePerCM(DetId detid, Iter a, Iter b)
float sensorThicknessInverse(DetId detid)
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
Definition: DetId.h:18
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
ModuleGeometry moduleGeometry() const
Definition: SiStripDetId.h:134