13 : theTracksLabel( iConfig.getParameter<edm::
InputTag>(
"Tracks") ),
14 Suffix ( iConfig.getParameter<std::
string>(
"Suffix") ),
17 produces <std::vector<int> > (
Prefix +
"trackindex" +
Suffix );
18 produces <std::vector<unsigned int> > (
Prefix +
"rawid" +
Suffix );
19 produces <std::vector<float> > (
Prefix +
"localdirx" +
Suffix );
20 produces <std::vector<float> > (
Prefix +
"localdiry" +
Suffix );
21 produces <std::vector<float> > (
Prefix +
"localdirz" +
Suffix );
22 produces <std::vector<unsigned short> > (
Prefix +
"firststrip" +
Suffix );
23 produces <std::vector<unsigned short> > (
Prefix +
"nstrips" +
Suffix );
24 produces <std::vector<bool> > (
Prefix +
"saturation" +
Suffix );
25 produces <std::vector<bool> > (
Prefix +
"overlapping" +
Suffix );
26 produces <std::vector<bool> > (
Prefix +
"farfromedge" +
Suffix );
27 produces <std::vector<unsigned int> > (
Prefix +
"charge" +
Suffix );
28 produces <std::vector<float> > (
Prefix +
"path" +
Suffix );
29 produces <std::vector<float> > (
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 std::auto_ptr<std::vector<int> > trackindex (
new std::vector<int> );
38 std::auto_ptr<std::vector<unsigned int> > rawid (
new std::vector<unsigned int> );
39 std::auto_ptr<std::vector<float> > localdirx (
new std::vector<float> );
40 std::auto_ptr<std::vector<float> > localdiry (
new std::vector<float> );
41 std::auto_ptr<std::vector<float> > localdirz (
new std::vector<float> );
42 std::auto_ptr<std::vector<unsigned short> > firststrip (
new std::vector<unsigned short> );
43 std::auto_ptr<std::vector<unsigned short> > nstrips (
new std::vector<unsigned short> );
44 std::auto_ptr<std::vector<bool> > saturation (
new std::vector<bool> );
45 std::auto_ptr<std::vector<bool> > overlapping (
new std::vector<bool> );
46 std::auto_ptr<std::vector<bool> > farfromedge (
new std::vector<bool> );
47 std::auto_ptr<std::vector<unsigned int> >
charge (
new std::vector<unsigned int> );
48 std::auto_ptr<std::vector<float> >
path (
new std::vector<float> );
49 std::auto_ptr<std::vector<float> > chargeoverpath(
new std::vector<float> );
50 std::auto_ptr<std::vector<unsigned char> > amplitude (
new std::vector<unsigned char> );
51 std::auto_ptr<std::vector<double> > gainused (
new std::vector<double> );
52 std::auto_ptr<std::vector<double> > gainusedTick (
new std::vector<double> );
61 const Trajectory* traj = association->key.get();
64 vector<TrajectoryMeasurement> measurements = traj->
measurements();
65 for(vector<TrajectoryMeasurement>::const_iterator measurement_it = measurements.begin(); measurement_it!=measurements.end(); measurement_it++){
67 if( !trajState.
isValid() )
continue;
79 for(
unsigned int h=0;
h<2;
h++){
80 if(!sistripmatchedhit &&
h==1){
82 }
else if(sistripmatchedhit &&
h==0){
84 DetId = sistripmatchedhit->
monoId();
85 }
else if(sistripmatchedhit &&
h==1){
87 DetId = sistripmatchedhit->
stereoId();
88 }
else if(sistripsimplehit){
89 StripCluster = (sistripsimplehit->
cluster()).
get();
91 }
else if(sistripsimple1dhit){
92 StripCluster = (sistripsimple1dhit->
cluster()).
get();
95 PixelCluster = (sipixelhit->
cluster()).
get();
102 double cosine = trackDirection.
z()/trackDirection.
mag();
103 bool Saturation =
false;
104 bool Overlapping =
false;
105 unsigned int Charge = 0;
107 double PrevGain = -1;
108 double PrevGainTick = -1;
113 const auto & Ampls = StripCluster->
amplitudes();
115 NStrips = Ampls.size();
116 int APVId = FirstStrip/128;
120 PrevGain = gainHandle->getApvGain(APVId,gainHandle->getRange(DetId, 1),1);
121 PrevGainTick = gainHandle->getApvGain(APVId,gainHandle->getRange(DetId, 0),1);
124 for(
unsigned int a=0;
a<Ampls.size();
a++){
126 if(Ampls[
a] >=254)Saturation =
true;
127 amplitude->push_back( Ampls[
a] );
130 if(FirstStrip==0 )Overlapping=
true;
131 if(FirstStrip==128 )Overlapping=
true;
132 if(FirstStrip==256 )Overlapping=
true;
133 if(FirstStrip==384 )Overlapping=
true;
134 if(FirstStrip==512 )Overlapping=
true;
135 if(FirstStrip==640 )Overlapping=
true;
137 if(FirstStrip<=127 && FirstStrip+Ampls.size()>127)Overlapping=
true;
138 if(FirstStrip<=255 && FirstStrip+Ampls.size()>255)Overlapping=
true;
139 if(FirstStrip<=383 && FirstStrip+Ampls.size()>383)Overlapping=
true;
140 if(FirstStrip<=511 && FirstStrip+Ampls.size()>511)Overlapping=
true;
141 if(FirstStrip<=639 && FirstStrip+Ampls.size()>639)Overlapping=
true;
143 if(FirstStrip+Ampls.size()==127 )Overlapping=
true;
144 if(FirstStrip+Ampls.size()==255 )Overlapping=
true;
145 if(FirstStrip+Ampls.size()==383 )Overlapping=
true;
146 if(FirstStrip+Ampls.size()==511 )Overlapping=
true;
147 if(FirstStrip+Ampls.size()==639 )Overlapping=
true;
148 if(FirstStrip+Ampls.size()==767 )Overlapping=
true;
149 }
else if(PixelCluster){
150 const auto& Ampls = PixelCluster->
pixelADC();
153 FirstStrip = ((FirstRow/80)<<3 | (FirstCol/52)) * 128;
158 for(
unsigned int a=0;
a<Ampls.size();
a++){
160 if(Ampls[
a] >=254)Saturation =
true;
163 double ChargeOverPath = (double)Charge / Path ;
166 rawid ->push_back( DetId );
167 localdirx ->push_back( trackDirection.
x() );
168 localdiry ->push_back( trackDirection.
y() );
169 localdirz ->push_back( trackDirection.
z() );
170 firststrip ->push_back( FirstStrip );
171 nstrips ->push_back( NStrips );
172 saturation ->push_back( Saturation );
173 overlapping ->push_back( Overlapping );
174 farfromedge ->push_back( StripCluster ?
IsFarFromBorder(&trajState,DetId, &iSetup) :
true );
175 charge ->push_back( Charge );
176 path ->push_back( Path );
177 chargeoverpath->push_back( ChargeOverPath );
178 gainused ->push_back( PrevGain );
179 gainusedTick ->push_back( PrevGainTick );
265 if (dynamic_cast<const StripGeomDetUnit*>(it)==0 && dynamic_cast<const PixelGeomDetUnit*>(it)==0) {
266 std::cout <<
"this detID doesn't seem to belong to the Tracker" << std::endl;
271 const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
272 const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds())));
274 double DistFromBorder = 1.0;
277 if(trapezoidalBounds)
279 std::array<const float, 4>
const &
parameters = (*trapezoidalBounds).parameters();
280 HalfLength = parameters[3];
281 }
else if(rectangularBounds){
285 if (fabs(HitLocalPos.
y())+HitLocalError.
yy() >= (HalfLength - DistFromBorder) )
return false;
297 double detThickness=1.;
302 if (!isPixel && ! isStrip) {
304 edm::LogWarning(
"DeDxHitsProducer") <<
"\t\t this detID doesn't seem to belong to the Tracker";
307 detThickness = it->surface().bounds().thickness();
ClusterRef cluster() const
virtual const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
unsigned int stereoId() const
virtual float length() const =0
friend struct const_iterator
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)
uint32_t rawId() const
get the raw id
DataContainer const & measurements() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ClusterRef cluster() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
const LocalTrajectoryError & localError() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
Pixel cluster – collection of neighboring pixels above threshold.
bool isPixel(HitType hitType)
unsigned int monoId() const
DetId geographicalId() const
edm::InputTag theTracksLabel
const std::vector< uint8_t > & amplitudes() const