13 Suffix(iConfig.getParameter<
std::
string>(
"Suffix")),
15 produces<std::vector<int>>(
Prefix +
"trackindex" +
Suffix);
16 produces<std::vector<unsigned int>>(
Prefix +
"rawid" +
Suffix);
17 produces<std::vector<double>>(
Prefix +
"localdirx" +
Suffix);
18 produces<std::vector<double>>(
Prefix +
"localdiry" +
Suffix);
19 produces<std::vector<double>>(
Prefix +
"localdirz" +
Suffix);
20 produces<std::vector<unsigned short>>(
Prefix +
"firststrip" +
Suffix);
21 produces<std::vector<unsigned short>>(
Prefix +
"nstrips" +
Suffix);
22 produces<std::vector<bool>>(
Prefix +
"saturation" +
Suffix);
23 produces<std::vector<bool>>(
Prefix +
"overlapping" +
Suffix);
24 produces<std::vector<bool>>(
Prefix +
"farfromedge" +
Suffix);
25 produces<std::vector<unsigned int>>(
Prefix +
"charge" +
Suffix);
27 #ifdef ExtendedCALIBTree 28 produces<std::vector<double>>(
Prefix +
"chargeoverpath" +
Suffix);
30 produces<std::vector<unsigned char>>(
Prefix +
"amplitude" +
Suffix);
31 produces<std::vector<double>>(
Prefix +
"gainused" +
Suffix);
32 produces<std::vector<double>>(
Prefix +
"gainusedTick" +
Suffix);
36 auto trackindex = std::make_unique<std::vector<int>>();
37 auto rawid = std::make_unique<std::vector<unsigned int>>();
38 auto localdirx = std::make_unique<std::vector<double>>();
39 auto localdiry = std::make_unique<std::vector<double>>();
40 auto localdirz = std::make_unique<std::vector<double>>();
41 auto firststrip = std::make_unique<std::vector<unsigned short>>();
42 auto nstrips = std::make_unique<std::vector<unsigned short>>();
43 auto saturation = std::make_unique<std::vector<bool>>();
44 auto overlapping = std::make_unique<std::vector<bool>>();
45 auto farfromedge = std::make_unique<std::vector<bool>>();
46 auto charge = std::make_unique<std::vector<unsigned int>>();
47 auto path = std::make_unique<std::vector<double>>();
48 #ifdef ExtendedCALIBTree 49 auto chargeoverpath = std::make_unique<std::vector<double>>();
51 auto amplitude = std::make_unique<std::vector<unsigned char>>();
52 auto gainused = std::make_unique<std::vector<double>>();
53 auto gainusedTick = std::make_unique<std::vector<double>>();
68 vector<TrajectoryMeasurement> measurements = traj->
measurements();
69 for (vector<TrajectoryMeasurement>::const_iterator measurement_it = measurements.begin();
70 measurement_it != measurements.end();
86 for (
unsigned int h = 0;
h < 2;
h++) {
87 if (!sistripmatchedhit &&
h == 1) {
89 }
else if (sistripmatchedhit &&
h == 0) {
92 }
else if (sistripmatchedhit &&
h == 1) {
96 }
else if (sistripsimplehit) {
97 StripCluster = (sistripsimplehit->
cluster()).
get();
99 }
else if (sistripsimple1dhit) {
100 StripCluster = (sistripsimple1dhit->
cluster()).
get();
102 }
else if (sipixelhit) {
103 PixelCluster = (sipixelhit->
cluster()).
get();
110 double cosine = trackDirection.
z() / trackDirection.
mag();
111 bool Saturation =
false;
115 double PrevGain = -1;
116 double PrevGainTick = -1;
121 const auto& Ampls = StripCluster->
amplitudes();
123 NStrips = Ampls.size();
124 int APVId = FirstStrip / 128;
131 for (
unsigned int a = 0;
a < Ampls.size();
a++) {
140 if (FirstStrip == 128)
142 if (FirstStrip == 256)
144 if (FirstStrip == 384)
146 if (FirstStrip == 512)
148 if (FirstStrip == 640)
151 if (FirstStrip <= 127 && FirstStrip + Ampls.size() > 127)
153 if (FirstStrip <= 255 && FirstStrip + Ampls.size() > 255)
155 if (FirstStrip <= 383 && FirstStrip + Ampls.size() > 383)
157 if (FirstStrip <= 511 && FirstStrip + Ampls.size() > 511)
159 if (FirstStrip <= 639 && FirstStrip + Ampls.size() > 639)
162 if (FirstStrip + Ampls.size() == 127)
164 if (FirstStrip + Ampls.size() == 255)
166 if (FirstStrip + Ampls.size() == 383)
168 if (FirstStrip + Ampls.size() == 511)
170 if (FirstStrip + Ampls.size() == 639)
172 if (FirstStrip + Ampls.size() == 767)
174 }
else if (PixelCluster) {
175 const auto& Ampls = PixelCluster->
pixelADC();
178 FirstStrip = ((FirstRow / 80) << 3 | (FirstCol / 52)) * 128;
183 for (
unsigned int a = 0;
a < Ampls.size();
a++) {
189 #ifdef ExtendedCALIBTree 190 double ChargeOverPath = (double)
Charge /
Path;
194 rawid->push_back(
DetId);
195 localdirx->push_back(trackDirection.
x());
196 localdiry->push_back(trackDirection.
y());
197 localdirz->push_back(trackDirection.
z());
198 firststrip->push_back(FirstStrip);
199 nstrips->push_back(NStrips);
205 #ifdef ExtendedCALIBTree 206 chargeoverpath->push_back(ChargeOverPath);
208 gainused->push_back(PrevGain);
209 gainusedTick->push_back(PrevGainTick);
226 #ifdef ExtendedCALIBTree 235 const uint32_t detid,
243 if (dynamic_cast<const StripGeomDetUnit*>(
it) ==
nullptr && dynamic_cast<const PixelGeomDetUnit*>(
it) ==
nullptr) {
244 throw cms::Exception(
"Logic Error") <<
"\t\t this detID doesn't seem to belong to the Tracker";
248 const TrapezoidalPlaneBounds* trapezoidalBounds(dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
249 const RectangularPlaneBounds* rectangularBounds(dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds())));
251 double DistFromBorder = 1.0;
252 double HalfLength =
it->surface().bounds().length() / 2.0;
254 if (trapezoidalBounds) {
255 std::array<const float, 4>
const&
parameters = (*trapezoidalBounds).parameters();
257 }
else if (rectangularBounds) {
263 if (fabs(HitLocalPos.
y()) + HitLocalError.
yy() >= (
HalfLength - DistFromBorder))
274 double detThickness = 1.;
280 throw cms::Exception(
"Logic Error") <<
"\t\t this detID doesn't seem to belong to the Tracker";
282 detThickness =
it->surface().bounds().thickness();
ClusterRef cluster() const
uint16_t firstStrip() const
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const LocalTrajectoryError & localError() const
LocalPoint localPosition() const
friend struct const_iterator
int findTrackIndex(const edm::Handle< edm::View< reco::Track > > &h, const reco::Track *t)
double thickness(DetId id)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometry_token_
std::map< DetId, double > m_thicknessMap
const SiStripApvGain::Range getRange(uint32_t detID) const
unsigned int stereoId() const
LocalError positionError() const
ShallowGainCalibration(const edm::ParameterSet &)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeom_token_
ClusterRef cluster() const
static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range)
DataContainer const & measurements() const
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
SiStripCluster const & monoCluster() const
SiStripCluster const & amplitudes() const
LocalVector localDirection() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const edm::EDGetTokenT< TrajTrackAssociationCollection > association_token_
const TrackerGeometry * m_tracker
unsigned int monoId() const
DetId geographicalId() const
constexpr uint32_t rawId() const
get the raw id
bool isFarFromBorder(TrajectoryStateOnSurface *trajState, const uint32_t detid, const edm::EventSetup *iSetup)
SiStripCluster const & stereoCluster() const
Pixel cluster – collection of neighboring pixels above threshold.
bool isPixel(HitType hitType)
const edm::ESGetToken< SiStripGain, SiStripGainRcd > gain_token_
void produce(edm::Event &, const edm::EventSetup &) override
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
ClusterRef cluster() const
const std::vector< uint16_t > & pixelADC() const