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 produces <std::vector<double> > (
Prefix +
"chargeoverpath" +
Suffix );
28 produces <std::vector<unsigned char> > (
Prefix +
"amplitude" +
Suffix );
29 produces <std::vector<double> > (
Prefix +
"gainused" +
Suffix );
30 produces <std::vector<double> > (
Prefix +
"gainusedTick" +
Suffix );
35 auto trackindex = std::make_unique<std::vector<int>> ();
36 auto rawid = std::make_unique<std::vector<unsigned int>> ();
37 auto localdirx = std::make_unique<std::vector<double>> ();
38 auto localdiry = std::make_unique<std::vector<double>> ();
39 auto localdirz = std::make_unique<std::vector<double>> ();
40 auto firststrip = std::make_unique<std::vector<unsigned short>> ();
41 auto nstrips = std::make_unique<std::vector<unsigned short>> ();
42 auto saturation = std::make_unique<std::vector<bool>> ();
43 auto overlapping = std::make_unique<std::vector<bool>> ();
44 auto farfromedge = std::make_unique<std::vector<bool>> ();
45 auto charge = std::make_unique<std::vector<unsigned int>> ();
46 auto path = std::make_unique<std::vector<double>> ();
47 auto chargeoverpath= std::make_unique<std::vector<double>> ();
48 auto amplitude = std::make_unique<std::vector<unsigned char>> ();
49 auto gainused = std::make_unique<std::vector<double>> ();
50 auto gainusedTick = std::make_unique<std::vector<double>> ();
62 vector<TrajectoryMeasurement> measurements = traj->
measurements();
63 for(vector<TrajectoryMeasurement>::const_iterator measurement_it = measurements.begin(); measurement_it!=measurements.end(); measurement_it++){
65 if( !trajState.
isValid() )
continue;
77 for(
unsigned int h=0;
h<2;
h++){
78 if(!sistripmatchedhit &&
h==1){
80 }
else if(sistripmatchedhit &&
h==0){
82 DetId = sistripmatchedhit->
monoId();
83 }
else if(sistripmatchedhit &&
h==1){
85 DetId = sistripmatchedhit->
stereoId();
86 }
else if(sistripsimplehit){
87 StripCluster = (sistripsimplehit->
cluster()).
get();
89 }
else if(sistripsimple1dhit){
90 StripCluster = (sistripsimple1dhit->
cluster()).
get();
93 PixelCluster = (sipixelhit->
cluster()).
get();
100 double cosine = trackDirection.
z()/trackDirection.
mag();
101 bool Saturation =
false;
103 unsigned int Charge = 0;
105 double PrevGain = -1;
106 double PrevGainTick = -1;
111 const auto & Ampls = StripCluster->
amplitudes();
113 NStrips = Ampls.size();
114 int APVId = FirstStrip/128;
122 for(
unsigned int a=0;
a<Ampls.size();
a++){
124 if(Ampls[
a] >=254)Saturation =
true;
125 amplitude->push_back( Ampls[
a] );
128 if(FirstStrip==0 )Overlapping=
true;
129 if(FirstStrip==128 )Overlapping=
true;
130 if(FirstStrip==256 )Overlapping=
true;
131 if(FirstStrip==384 )Overlapping=
true;
132 if(FirstStrip==512 )Overlapping=
true;
133 if(FirstStrip==640 )Overlapping=
true;
135 if(FirstStrip<=127 && FirstStrip+Ampls.size()>127)Overlapping=
true;
136 if(FirstStrip<=255 && FirstStrip+Ampls.size()>255)Overlapping=
true;
137 if(FirstStrip<=383 && FirstStrip+Ampls.size()>383)Overlapping=
true;
138 if(FirstStrip<=511 && FirstStrip+Ampls.size()>511)Overlapping=
true;
139 if(FirstStrip<=639 && FirstStrip+Ampls.size()>639)Overlapping=
true;
141 if(FirstStrip+Ampls.size()==127 )Overlapping=
true;
142 if(FirstStrip+Ampls.size()==255 )Overlapping=
true;
143 if(FirstStrip+Ampls.size()==383 )Overlapping=
true;
144 if(FirstStrip+Ampls.size()==511 )Overlapping=
true;
145 if(FirstStrip+Ampls.size()==639 )Overlapping=
true;
146 if(FirstStrip+Ampls.size()==767 )Overlapping=
true;
147 }
else if(PixelCluster){
148 const auto& Ampls = PixelCluster->
pixelADC();
151 FirstStrip = ((FirstRow/80)<<3 | (FirstCol/52)) * 128;
156 for(
unsigned int a=0;
a<Ampls.size();
a++){
158 if(Ampls[
a] >=254)Saturation =
true;
161 double ChargeOverPath = (double)Charge / Path ;
164 rawid ->push_back( DetId );
165 localdirx ->push_back( trackDirection.
x() );
166 localdiry ->push_back( trackDirection.
y() );
167 localdirz ->push_back( trackDirection.
z() );
168 firststrip ->push_back( FirstStrip );
169 nstrips ->push_back( NStrips );
170 saturation ->push_back( Saturation );
171 overlapping ->push_back( Overlapping );
172 farfromedge ->push_back( StripCluster ?
IsFarFromBorder(&trajState,DetId, &iSetup) :
true );
173 charge ->push_back( Charge );
174 path ->push_back( Path );
175 chargeoverpath->push_back( ChargeOverPath );
176 gainused ->push_back( PrevGain );
177 gainusedTick ->push_back( PrevGainTick );
263 if (dynamic_cast<const StripGeomDetUnit*>(it)==0 && dynamic_cast<const PixelGeomDetUnit*>(it)==0) {
264 std::cout <<
"this detID doesn't seem to belong to the Tracker" << std::endl;
269 const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
270 const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds())));
272 double DistFromBorder = 1.0;
275 if(trapezoidalBounds)
277 std::array<const float, 4>
const &
parameters = (*trapezoidalBounds).parameters();
278 HalfLength = parameters[3];
279 }
else if(rectangularBounds){
283 if (fabs(HitLocalPos.
y())+HitLocalError.
yy() >= (HalfLength - DistFromBorder) )
return false;
295 double detThickness=1.;
300 if (!isPixel && ! isStrip) {
302 edm::LogWarning(
"DeDxHitsProducer") <<
"\t\t this detID doesn't seem to belong to the Tracker";
305 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
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)
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)
uint32_t rawId() const
get the raw id
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
void produce(edm::Event &, const edm::EventSetup &)
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
const std::vector< uint8_t > & amplitudes() const
const SiStripApvGain::Range getRange(uint32_t detID) const