100 std::vector<double> c_localdirx;
101 std::vector<double> c_localdiry;
102 std::vector<double> c_localdirz;
103 std::vector<uint16_t> c_firststrip;
104 std::vector<uint16_t> c_nstrips;
105 std::vector<bool> c_saturation;
106 std::vector<bool> c_overlapping;
107 std::vector<bool> c_farfromedge;
108 std::vector<int> c_charge;
109 std::vector<double> c_path;
112 std::vector<float> c_gainused;
113 std::vector<float> c_gainusedTick;
115 const auto& ampls = clus.cluster->amplitudes();
116 const int firstStrip = clus.cluster->firstStrip();
117 const int nStrips = ampls.size();
118 double prevGain = -1;
119 double prevGainTick = -1;
121 prevGain = stripGains->
getApvGain(firstStrip / 128, stripGains->
getRange(clus.det, 1), 1);
122 prevGainTick = stripGains->
getApvGain(firstStrip / 128, stripGains->
getRange(clus.det, 0), 1);
124 const unsigned int charge = clus.cluster->charge();
125 const bool saturation = std::any_of(ampls.begin(), ampls.end(), [](uint8_t amp) {
return amp >= 254; });
127 const bool overlapping = (((firstStrip % 128) == 0) || ((firstStrip / 128) != ((firstStrip +
nStrips) / 128)) ||
128 (((firstStrip +
nStrips) % 128) == 127));
129 const auto& trajState = clus.measurement.updatedState();
130 const auto trackDir = trajState.localDirection();
131 const auto cosine = trackDir.z() / trackDir.mag();
134 c_localdirx.push_back(trackDir.x());
135 c_localdiry.push_back(trackDir.y());
136 c_localdirz.push_back(trackDir.z());
137 c_firststrip.push_back(firstStrip);
140 c_overlapping.push_back(overlapping);
141 c_farfromedge.push_back(farFromEdge);
142 c_charge.push_back(
charge);
143 c_path.push_back(
path);
144 c_gainused.push_back(prevGain);
145 c_gainusedTick.push_back(prevGainTick);
const SiStripApvGain::Range getRange(uint32_t detID) const
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
double thickness(DetId id, const TrackerGeometry *tGeom)
static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range)
T const * product() const
Abs< T >::type abs(const T &t)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
static void addColumn(nanoaod::FlatTable *table, const std::string &name, VALUES &&values, const std::string &doc)
const edm::ESGetToken< SiStripGain, SiStripGainRcd > m_gainToken
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_tkGeomToken