12 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 );
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 std::auto_ptr<std::vector<int> > trackindex (
new std::vector<int> );
36 std::auto_ptr<std::vector<unsigned int> > rawid (
new std::vector<unsigned int> );
37 std::auto_ptr<std::vector<double> > localdirx (
new std::vector<double> );
38 std::auto_ptr<std::vector<double> > localdiry (
new std::vector<double> );
39 std::auto_ptr<std::vector<double> > localdirz (
new std::vector<double> );
40 std::auto_ptr<std::vector<unsigned short> > firststrip (
new std::vector<unsigned short> );
41 std::auto_ptr<std::vector<unsigned short> > nstrips (
new std::vector<unsigned short> );
42 std::auto_ptr<std::vector<bool> > saturation (
new std::vector<bool> );
43 std::auto_ptr<std::vector<bool> > overlapping (
new std::vector<bool> );
44 std::auto_ptr<std::vector<bool> > farfromedge (
new std::vector<bool> );
45 std::auto_ptr<std::vector<unsigned int> >
charge (
new std::vector<unsigned int> );
46 std::auto_ptr<std::vector<double> >
path (
new std::vector<double> );
47 std::auto_ptr<std::vector<double> > chargeoverpath(
new std::vector<double> );
48 std::auto_ptr<std::vector<unsigned char> > amplitude (
new std::vector<unsigned char> );
49 std::auto_ptr<std::vector<double> > gainused (
new std::vector<double> );
50 std::auto_ptr<std::vector<double> > gainusedTick (
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;
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;
102 bool Overlapping =
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;
118 PrevGain = gainHandle->getApvGain(APVId,gainHandle->getRange(DetId, 1),1);
119 PrevGainTick = gainHandle->getApvGain(APVId,gainHandle->getRange(DetId, 0),1);
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 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
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
friend struct const_iterator
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)
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
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
DetId geographicalId() const
const std::vector< uint8_t > & amplitudes() const