13 : theTracksLabel( iConfig.getParameter<edm::
InputTag>(
"Tracks") ),
14 Suffix ( iConfig.getParameter<std::string>(
"Suffix") ),
15 Prefix ( iConfig.getParameter<std::string>(
"Prefix") )
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 );
36 std::auto_ptr<std::vector<int> > trackindex (
new std::vector<int> );
37 std::auto_ptr<std::vector<unsigned int> > rawid (
new std::vector<unsigned int> );
38 std::auto_ptr<std::vector<float> > localdirx (
new std::vector<float> );
39 std::auto_ptr<std::vector<float> > localdiry (
new std::vector<float> );
40 std::auto_ptr<std::vector<float> > localdirz (
new std::vector<float> );
41 std::auto_ptr<std::vector<unsigned short> > firststrip (
new std::vector<unsigned short> );
42 std::auto_ptr<std::vector<unsigned short> > nstrips (
new std::vector<unsigned short> );
43 std::auto_ptr<std::vector<bool> > saturation (
new std::vector<bool> );
44 std::auto_ptr<std::vector<bool> > overlapping (
new std::vector<bool> );
45 std::auto_ptr<std::vector<bool> > farfromedge (
new std::vector<bool> );
46 std::auto_ptr<std::vector<unsigned int> >
charge (
new std::vector<unsigned int> );
47 std::auto_ptr<std::vector<float> >
path (
new std::vector<float> );
48 std::auto_ptr<std::vector<float> > chargeoverpath(
new std::vector<float> );
49 std::auto_ptr<std::vector<unsigned char> > amplitude (
new std::vector<unsigned char> );
50 std::auto_ptr<std::vector<double> > gainused (
new std::vector<double> );
59 const Trajectory* traj = association->key.get();
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;
68 const SiStripRecHit1D* sistripsimple1dhit =
dynamic_cast<const SiStripRecHit1D*
>(hit);
69 const SiStripRecHit2D* sistripsimplehit =
dynamic_cast<const SiStripRecHit2D*
>(hit);
70 const SiStripMatchedRecHit2D* sistripmatchedhit =
dynamic_cast<const SiStripMatchedRecHit2D*
>(hit);
75 for(
unsigned int h=0;
h<2;
h++){
76 if(!sistripmatchedhit &&
h==1){
78 }
else if(sistripmatchedhit &&
h==0){
79 Cluster = &sistripmatchedhit->monoCluster();
80 DetId = sistripmatchedhit->monoId();
81 }
else if(sistripmatchedhit &&
h==1){
82 Cluster = &sistripmatchedhit->stereoCluster();;
83 DetId = sistripmatchedhit->stereoId();
84 }
else if(sistripsimplehit){
85 Cluster = (sistripsimplehit->cluster()).
get();
87 }
else if(sistripsimple1dhit){
88 Cluster = (sistripsimple1dhit->cluster()).
get();
95 double cosine = trackDirection.
z()/trackDirection.
mag();
96 const vector<uint8_t>& Ampls = Cluster->
amplitudes();
98 int APVId = FirstStrip/128;
99 bool Saturation =
false;
100 bool Overlapping =
false;
101 unsigned int Charge = 0;
103 double PrevGain = -1;
107 PrevGain = *(detGainRange.first + APVId);
110 for(
unsigned int a=0;
a<Ampls.size();
a++){
112 if(Ampls[
a] >=254)Saturation =
true;
113 amplitude->push_back( Ampls[
a] );
115 double ChargeOverPath = (double)Charge / Path ;
117 if(FirstStrip==0 )Overlapping=
true;
118 if(FirstStrip==128 )Overlapping=
true;
119 if(FirstStrip==256 )Overlapping=
true;
120 if(FirstStrip==384 )Overlapping=
true;
121 if(FirstStrip==512 )Overlapping=
true;
122 if(FirstStrip==640 )Overlapping=
true;
124 if(FirstStrip<=127 && FirstStrip+Ampls.size()>127)Overlapping=
true;
125 if(FirstStrip<=255 && FirstStrip+Ampls.size()>255)Overlapping=
true;
126 if(FirstStrip<=383 && FirstStrip+Ampls.size()>383)Overlapping=
true;
127 if(FirstStrip<=511 && FirstStrip+Ampls.size()>511)Overlapping=
true;
128 if(FirstStrip<=639 && FirstStrip+Ampls.size()>639)Overlapping=
true;
130 if(FirstStrip+Ampls.size()==127 )Overlapping=
true;
131 if(FirstStrip+Ampls.size()==255 )Overlapping=
true;
132 if(FirstStrip+Ampls.size()==383 )Overlapping=
true;
133 if(FirstStrip+Ampls.size()==511 )Overlapping=
true;
134 if(FirstStrip+Ampls.size()==639 )Overlapping=
true;
135 if(FirstStrip+Ampls.size()==767 )Overlapping=
true;
138 rawid ->push_back( DetId );
139 localdirx ->push_back( trackDirection.
x() );
140 localdiry ->push_back( trackDirection.
y() );
141 localdirz ->push_back( trackDirection.
z() );
142 firststrip ->push_back( FirstStrip );
143 nstrips ->push_back( Ampls.size() );
144 saturation ->push_back( Saturation );
145 overlapping ->push_back( Overlapping );
147 charge ->push_back( Charge );
148 path ->push_back( Path );
149 chargeoverpath->push_back( ChargeOverPath );
150 gainused ->push_back( PrevGain );
235 if (dynamic_cast<const StripGeomDetUnit*>(it)==0 && dynamic_cast<const PixelGeomDetUnit*>(it)==0) {
236 std::cout <<
"this detID doesn't seem to belong to the Tracker" << std::endl;
244 double DistFromBorder = 1.0;
247 if(trapezoidalBounds)
249 std::vector<float>
const &
parameters = (*trapezoidalBounds).parameters();
250 HalfLength = parameters[3];
251 }
else if(rectangularBounds){
255 if (fabs(HitLocalPos.
y())+HitLocalError.
yy() >= (HalfLength - DistFromBorder) )
return false;
267 double detThickness=1.;
272 if (!isPixel && ! isStrip) {
274 edm::LogWarning(
"DeDxHitsProducer") <<
"\t\t this detID doesn't seem to belong to the Tracker";
277 detThickness = it->surface().bounds().thickness();
virtual float length() const =0
int findTrackIndex(const edm::Handle< edm::View< reco::Track > > &h, const reco::Track *t)
LocalVector localDirection() const
LocalPoint localPosition() const
double thickness(DetId id)
std::map< DetId, double > m_thicknessMap
uint16_t firstStrip() const
ShallowGainCalibration(const edm::ParameterSet &)
LocalError positionError() const
bool IsFarFromBorder(TrajectoryStateOnSurface *trajState, const uint32_t detid, const edm::EventSetup *iSetup)
uint32_t geographicalId() const
DataContainer const & measurements() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::pair< ContainerIterator, ContainerIterator > Range
const LocalTrajectoryError & localError() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const Bounds & bounds() const
const TrackerGeometry * m_tracker
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void produce(edm::Event &, const edm::EventSetup &)
const BoundPlane & surface() const
The nominal surface of the GeomDet.
edm::InputTag theTracksLabel
const std::vector< uint8_t > & amplitudes() const