12 Suffix ( iConfig.getParameter<
std::
string>(
"Suffix") ),
13 Prefix ( iConfig.getParameter<
std::
string>(
"Prefix") )
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 );
26 produces <std::vector<double> > (
Prefix +
"path" +
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 );
37 auto trackindex = std::make_unique<std::vector<int>> ();
38 auto rawid = std::make_unique<std::vector<unsigned int>> ();
39 auto localdirx = std::make_unique<std::vector<double>> ();
40 auto localdiry = std::make_unique<std::vector<double>> ();
41 auto localdirz = std::make_unique<std::vector<double>> ();
42 auto firststrip = std::make_unique<std::vector<unsigned short>> ();
43 auto nstrips = std::make_unique<std::vector<unsigned short>> ();
44 auto saturation = std::make_unique<std::vector<bool>> ();
45 auto overlapping = std::make_unique<std::vector<bool>> ();
46 auto farfromedge = std::make_unique<std::vector<bool>> ();
47 auto charge = std::make_unique<std::vector<unsigned int>> ();
48 auto path = std::make_unique<std::vector<double>> ();
49 #ifdef ExtendedCALIBTree 50 auto chargeoverpath= std::make_unique<std::vector<double>> ();
52 auto amplitude = std::make_unique<std::vector<unsigned char>> ();
53 auto gainused = std::make_unique<std::vector<double>> ();
54 auto gainusedTick = std::make_unique<std::vector<double>> ();
66 vector<TrajectoryMeasurement> measurements = traj->
measurements();
67 for(vector<TrajectoryMeasurement>::const_iterator measurement_it = measurements.begin(); measurement_it!=measurements.end(); measurement_it++){
69 if( !trajState.
isValid() )
continue;
81 for(
unsigned int h=0;
h<2;
h++){
82 if(!sistripmatchedhit &&
h==1){
84 }
else if(sistripmatchedhit &&
h==0){
86 DetId = sistripmatchedhit->
monoId();
87 }
else if(sistripmatchedhit &&
h==1){
89 DetId = sistripmatchedhit->
stereoId();
90 }
else if(sistripsimplehit){
91 StripCluster = (sistripsimplehit->
cluster()).
get();
93 }
else if(sistripsimple1dhit){
94 StripCluster = (sistripsimple1dhit->
cluster()).
get();
97 PixelCluster = (sipixelhit->
cluster()).
get();
104 double cosine = trackDirection.
z()/trackDirection.
mag();
105 bool Saturation =
false;
107 unsigned int Charge = 0;
109 double PrevGain = -1;
110 double PrevGainTick = -1;
115 const auto & Ampls = StripCluster->
amplitudes();
117 NStrips = Ampls.size();
118 int APVId = FirstStrip/128;
126 for(
unsigned int a=0;
a<Ampls.size();
a++){
128 if(Ampls[
a] >=254)Saturation =
true;
129 amplitude->push_back( Ampls[
a] );
132 if(FirstStrip==0 )Overlapping=
true;
133 if(FirstStrip==128 )Overlapping=
true;
134 if(FirstStrip==256 )Overlapping=
true;
135 if(FirstStrip==384 )Overlapping=
true;
136 if(FirstStrip==512 )Overlapping=
true;
137 if(FirstStrip==640 )Overlapping=
true;
139 if(FirstStrip<=127 && FirstStrip+Ampls.size()>127)Overlapping=
true;
140 if(FirstStrip<=255 && FirstStrip+Ampls.size()>255)Overlapping=
true;
141 if(FirstStrip<=383 && FirstStrip+Ampls.size()>383)Overlapping=
true;
142 if(FirstStrip<=511 && FirstStrip+Ampls.size()>511)Overlapping=
true;
143 if(FirstStrip<=639 && FirstStrip+Ampls.size()>639)Overlapping=
true;
145 if(FirstStrip+Ampls.size()==127 )Overlapping=
true;
146 if(FirstStrip+Ampls.size()==255 )Overlapping=
true;
147 if(FirstStrip+Ampls.size()==383 )Overlapping=
true;
148 if(FirstStrip+Ampls.size()==511 )Overlapping=
true;
149 if(FirstStrip+Ampls.size()==639 )Overlapping=
true;
150 if(FirstStrip+Ampls.size()==767 )Overlapping=
true;
151 }
else if(PixelCluster){
152 const auto& Ampls = PixelCluster->
pixelADC();
155 FirstStrip = ((FirstRow/80)<<3 | (FirstCol/52)) * 128;
160 for(
unsigned int a=0;
a<Ampls.size();
a++){
162 if(Ampls[
a] >=254)Saturation =
true;
165 #ifdef ExtendedCALIBTree 166 double ChargeOverPath = (double)Charge / Path ;
170 rawid ->push_back( DetId );
171 localdirx ->push_back( trackDirection.
x() );
172 localdiry ->push_back( trackDirection.
y() );
173 localdirz ->push_back( trackDirection.
z() );
174 firststrip ->push_back( FirstStrip );
175 nstrips ->push_back( NStrips );
176 saturation ->push_back( Saturation );
177 overlapping ->push_back( Overlapping );
178 farfromedge ->push_back( StripCluster ?
IsFarFromBorder(&trajState,DetId, &iSetup) :
true );
179 charge ->push_back( Charge );
180 path ->push_back( Path );
181 #ifdef ExtendedCALIBTree 182 chargeoverpath->push_back( ChargeOverPath );
184 gainused ->push_back( PrevGain );
185 gainusedTick ->push_back( PrevGainTick );
202 #ifdef ExtendedCALIBTree 273 if (dynamic_cast<const StripGeomDetUnit*>(it)==
nullptr && dynamic_cast<const PixelGeomDetUnit*>(it)==
nullptr) {
274 std::cout <<
"this detID doesn't seem to belong to the Tracker" << std::endl;
279 const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
280 const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds())));
282 double DistFromBorder = 1.0;
285 if(trapezoidalBounds)
287 std::array<const float, 4>
const &
parameters = (*trapezoidalBounds).parameters();
288 HalfLength = parameters[3];
289 }
else if(rectangularBounds){
293 if (fabs(HitLocalPos.
y())+HitLocalError.
yy() >= (HalfLength - DistFromBorder) )
return false;
305 double detThickness=1.;
310 if (!isPixel && ! isStrip) {
312 edm::LogWarning(
"DeDxHitsProducer") <<
"\t\t this detID doesn't seem to belong to the Tracker";
315 detThickness = it->surface().bounds().thickness();
ClusterRef cluster() const
virtual float length() const =0
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
unsigned int stereoId() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
friend struct const_iterator
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int findTrackIndex(const edm::Handle< edm::View< reco::Track > > &h, const reco::Track *t)
SiStripCluster const & monoCluster() const
LocalVector localDirection() const
LocalPoint localPosition() const
double thickness(DetId id)
constexpr uint32_t rawId() const
get the raw id
std::map< DetId, double > m_thicknessMap
const Bounds & bounds() const
uint16_t firstStrip() const
ShallowGainCalibration(const edm::ParameterSet &)
const Plane & surface() const
The nominal surface of the GeomDet.
LocalError positionError() const
bool IsFarFromBorder(TrajectoryStateOnSurface *trajState, const uint32_t detid, const edm::EventSetup *iSetup)
static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
DataContainer const & measurements() const
ClusterRef cluster() const
const LocalTrajectoryError & localError() const
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
const std::vector< uint16_t > & pixelADC() const
const TrackerGeometry * m_tracker
ClusterRef cluster() const
SiStripCluster const & stereoCluster() const
const edm::EDGetTokenT< TrajTrackAssociationCollection > association_token_
Pixel cluster – collection of neighboring pixels above threshold.
bool isPixel(HitType hitType)
unsigned int monoId() const
const_iterator begin() const
first iterator over the map (read only)
DetId geographicalId() const
void produce(edm::Event &, const edm::EventSetup &) override
const std::vector< uint8_t > & amplitudes() const
const SiStripApvGain::Range getRange(uint32_t detID) const