CMS 3D CMS Logo

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
12  inline float sensorThicknessInverse(DetId detid) {
13  if (detid.subdetId() >= SiStripDetId::TIB) {
14  SiStripDetId siStripDetId = detid();
15  if (siStripDetId.subdetId() == SiStripDetId::TOB)
16  return 1.f / 0.047f;
17  if (siStripDetId.moduleGeometry() == SiStripModuleGeometry::W5 ||
18  siStripDetId.moduleGeometry() == SiStripModuleGeometry::W6 ||
19  siStripDetId.moduleGeometry() == SiStripModuleGeometry::W7)
20  return 1.f / 0.047f;
21  return 1.f / 0.029f; // so it is TEC ring 1-4 or TIB or TOB;
22  } else if (detid.subdetId() == 1)
23  return 1.f / 0.0285f;
24  else
25  return 1.f / 0.027f;
26  }
27 
28  template <typename Iter>
29  inline float chargePerCM(DetId detid, Iter a, Iter b) {
30  return float(std::accumulate(a, b, int(0))) * sensorThicknessInverse(detid);
31  }
32 
33  template <typename Clus>
34  inline float chargePerCM(DetId detid, Clus const& cl) {
35  return cl.charge() * sensorThicknessInverse(detid);
36  }
37 
38  template <typename Clus>
39  inline float chargePerCM(DetId detid, Clus const& cl, LocalTrajectoryParameters const& tp) {
40  return chargePerCM(detid, cl) * tp.absdz();
41  }
42 
43  template <typename Clus>
44  inline float chargePerCM(Clus const& cl, LocalTrajectoryParameters const& tp, float invThick) {
45  return cl.charge() * invThick * tp.absdz();
46  }
47 
48  template <typename Clus>
49  inline float chargePerCM(DetId detid, Clus const& cl, const LocalVector& ldir) {
50  return chargePerCM(detid, cl) * std::abs(ldir.z()) / ldir.mag();
51  }
52 
53 } // namespace siStripClusterTools
54 
55 #endif // DataFormatsSiStripClusterSiStripClusterTools_H
Vector3DBase< float, LocalTag >
SiStripDetId::moduleGeometry
SiStripModuleGeometry moduleGeometry() const
Definition: SiStripDetId.h:109
SiStripModuleGeometry::W7
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
siStripClusterTools::chargePerCM
float chargePerCM(DetId detid, Iter a, Iter b)
Definition: SiStripClusterTools.h:29
SiStripDetId.h
siStripClusterTools::sensorThicknessInverse
float sensorThicknessInverse(DetId detid)
Definition: SiStripClusterTools.h:12
SiStripModuleGeometry::W6
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
siStripClusterTools
Definition: SiStripClusterTools.h:9
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition: GetRecoTauVFromDQM_MC_cff.py:38
DetId
Definition: DetId.h:17
LocalTrajectoryParameters.h
SiStripModuleGeometry::W5
b
double b
Definition: hdecay.h:118
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
a
double a
Definition: hdecay.h:119
SiStripDetId::TOB
static constexpr auto TOB
Definition: SiStripDetId.h:39
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
SiStripDetId::TIB
static constexpr auto TIB
Definition: SiStripDetId.h:37
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18