CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ShallowGainCalibration Class Reference

#include <ShallowGainCalibration.h>

Inheritance diagram for ShallowGainCalibration:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ShallowGainCalibration (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

bool IsFarFromBorder (TrajectoryStateOnSurface *trajState, const uint32_t detid, const edm::EventSetup *iSetup)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
double thickness (DetId id)
 

Private Attributes

const edm::EDGetTokenT< TrajTrackAssociationCollectionassociation_token_
 
std::map< DetId, double > m_thicknessMap
 
const TrackerGeometrym_tracker
 
std::string Prefix
 
std::string Suffix
 
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 58 of file ShallowGainCalibration.h.

Constructor & Destructor Documentation

ShallowGainCalibration::ShallowGainCalibration ( const edm::ParameterSet iConfig)
explicit

Definition at line 9 of file ShallowGainCalibration.cc.

References Prefix, produce(), and Suffix.

11  association_token_( consumes< TrajTrackAssociationCollection >(iConfig.getParameter<edm::InputTag>("Tracks")) ),
12  Suffix ( iConfig.getParameter<std::string>("Suffix") ),
13  Prefix ( iConfig.getParameter<std::string>("Prefix") )
14 {
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 );
29  #endif
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 );
33 }
T getParameter(std::string const &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
const edm::EDGetTokenT< TrajTrackAssociationCollection > association_token_

Member Function Documentation

bool ShallowGainCalibration::IsFarFromBorder ( TrajectoryStateOnSurface trajState,
const uint32_t  detid,
const edm::EventSetup iSetup 
)
private

Definition at line 265 of file ShallowGainCalibration.cc.

References Surface::bounds(), gather_cfg::cout, edm::EventSetup::get(), TrackerGeometry::idToDetUnit(), Bounds::length(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LocalTrajectoryError::positionError(), GeomDet::surface(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

Referenced by produce().

266 {
267  edm::ESHandle<TrackerGeometry> tkGeom; iSetup->get<TrackerDigiGeometryRecord>().get( tkGeom );
268 
269  LocalPoint HitLocalPos = trajState->localPosition();
270  LocalError HitLocalError = trajState->localError().positionError() ;
271 
272  const GeomDetUnit* it = tkGeom->idToDetUnit(DetId(detid));
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;
275  return false;
276  }
277 
278  const BoundPlane plane = it->surface();
279  const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
280  const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds())));
281 
282  double DistFromBorder = 1.0;
283  double HalfLength = it->surface().bounds().length() /2.0;
284 
285  if(trapezoidalBounds)
286  {
287  std::array<const float, 4> const & parameters = (*trapezoidalBounds).parameters();
288  HalfLength = parameters[3];
289  }else if(rectangularBounds){
290  HalfLength = it->surface().bounds().length() /2.0;
291  }else{return false;}
292 
293  if (fabs(HitLocalPos.y())+HitLocalError.yy() >= (HalfLength - DistFromBorder) ) return false;
294 
295  return true;
296 }
virtual float length() const =0
T y() const
Definition: PV3DBase.h:63
const Bounds & bounds() const
Definition: Surface.h:120
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
LocalError positionError() const
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
float yy() const
Definition: LocalError.h:26
const LocalTrajectoryError & localError() const
Definition: DetId.h:18
T get() const
Definition: EventSetup.h:71
void ShallowGainCalibration::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 36 of file ShallowGainCalibration.cc.

References a, CustomPhysics_cfi::amplitude, SiStripCluster::amplitudes(), TrackValidation_cff::association, association_token_, genericTrackCandidates_cff::associations, edm::AssociationMap< Tag >::begin(), ALCARECOTkAlJpsiMuMu_cff::charge, SiStripRecHit1D::cluster(), SiStripRecHit2D::cluster(), SiPixelRecHit::cluster(), edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, edm::AssociationMap< Tag >::end(), shallow::findTrackIndex(), SiStripCluster::firstStrip(), TrackingRecHit::geographicalId(), edm::EventSetup::get(), SiStripGain::getApvGain(), edm::Event::getByToken(), SiStripGain::getRange(), h, IsFarFromBorder(), edm::ESHandleBase::isValid(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), m_tracker, PV3DBase< T, PVType, FrameType >::mag(), Trajectory::measurements(), SiPixelCluster::minPixelCol(), SiPixelCluster::minPixelRow(), SiStripMatchedRecHit2D::monoCluster(), SiStripMatchedRecHit2D::monoId(), eostools::move(), Overlapping, callgraph::path, SiPixelCluster::pixelADC(), Prefix, edm::Event::put(), DetId::rawId(), SiStripMatchedRecHit2D::stereoCluster(), SiStripMatchedRecHit2D::stereoId(), Suffix, thickness(), HiIsolationCommonParameters_cff::track, l1t::tracks, tracks_token_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), HTMLExport.HTMLExportStatic::export(), and ShallowGainCalibration().

36  {
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>> ();
51  #endif
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>> ();
55 
56  edm::ESHandle<TrackerGeometry> theTrackerGeometry; iSetup.get<TrackerDigiGeometryRecord>().get( theTrackerGeometry );
57  m_tracker=&(* theTrackerGeometry );
58  edm::ESHandle<SiStripGain> gainHandle; iSetup.get<SiStripGainRcd>().get(gainHandle);
61 
62  for( TrajTrackAssociationCollection::const_iterator association = associations->begin(); association != associations->end(); association++) {
63  const Trajectory* traj = association->key.get();
64  const reco::Track* track = association->val.get();
65 
66  vector<TrajectoryMeasurement> measurements = traj->measurements();
67  for(vector<TrajectoryMeasurement>::const_iterator measurement_it = measurements.begin(); measurement_it!=measurements.end(); measurement_it++){
68  TrajectoryStateOnSurface trajState = measurement_it->updatedState();
69  if( !trajState.isValid() ) continue;
70 
71  const TrackingRecHit* hit = (*measurement_it->recHit()).hit();
72  const SiStripRecHit1D* sistripsimple1dhit = dynamic_cast<const SiStripRecHit1D*>(hit);
73  const SiStripRecHit2D* sistripsimplehit = dynamic_cast<const SiStripRecHit2D*>(hit);
74  const SiStripMatchedRecHit2D* sistripmatchedhit = dynamic_cast<const SiStripMatchedRecHit2D*>(hit);
75  const SiPixelRecHit* sipixelhit = dynamic_cast<const SiPixelRecHit*>(hit);
76 
77  const SiPixelCluster* PixelCluster = nullptr;
78  const SiStripCluster* StripCluster = nullptr;
79  uint32_t DetId = 0;
80 
81  for(unsigned int h=0;h<2;h++){
82  if(!sistripmatchedhit && h==1){
83  continue;
84  }else if(sistripmatchedhit && h==0){
85  StripCluster = &sistripmatchedhit->monoCluster();
86  DetId = sistripmatchedhit->monoId();
87  }else if(sistripmatchedhit && h==1){
88  StripCluster = &sistripmatchedhit->stereoCluster();;
89  DetId = sistripmatchedhit->stereoId();
90  }else if(sistripsimplehit){
91  StripCluster = (sistripsimplehit->cluster()).get();
92  DetId = sistripsimplehit->geographicalId().rawId();
93  }else if(sistripsimple1dhit){
94  StripCluster = (sistripsimple1dhit->cluster()).get();
95  DetId = sistripsimple1dhit->geographicalId().rawId();
96  }else if(sipixelhit){
97  PixelCluster = (sipixelhit->cluster()).get();
98  DetId = sipixelhit->geographicalId().rawId();
99  }else{
100  continue;
101  }
102 
103  LocalVector trackDirection = trajState.localDirection();
104  double cosine = trackDirection.z()/trackDirection.mag();
105  bool Saturation = false;
106  bool Overlapping = false;
107  unsigned int Charge = 0;
108  double Path = (10.0*thickness(DetId))/fabs(cosine);
109  double PrevGain = -1;
110  double PrevGainTick = -1;
111  int FirstStrip = 0;
112  int NStrips = 0;
113 
114  if(StripCluster){
115  const auto & Ampls = StripCluster->amplitudes();
116  FirstStrip = StripCluster->firstStrip();
117  NStrips = Ampls.size();
118  int APVId = FirstStrip/128;
119 
120 
121  if(gainHandle.isValid()){
122  PrevGain = gainHandle->getApvGain(APVId,gainHandle->getRange(DetId, 1),1);
123  PrevGainTick = gainHandle->getApvGain(APVId,gainHandle->getRange(DetId, 0),1);
124  }
125 
126  for(unsigned int a=0;a<Ampls.size();a++){
127  Charge+=Ampls[a];
128  if(Ampls[a] >=254)Saturation =true;
129  amplitude->push_back( Ampls[a] );
130  }
131 
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;
138 
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;
144 
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();
153  int FirstRow = PixelCluster->minPixelRow();
154  int FirstCol = PixelCluster->minPixelCol();
155  FirstStrip = ((FirstRow/80)<<3 | (FirstCol/52)) * 128; //Hack to save the APVId
156  NStrips = 0;
157  Saturation = false;
158  Overlapping = false;
159 
160  for(unsigned int a=0;a<Ampls.size();a++){
161  Charge+=Ampls[a];
162  if(Ampls[a] >=254)Saturation =true;
163  }
164  }
165  #ifdef ExtendedCALIBTree
166  double ChargeOverPath = (double)Charge / Path ;
167  #endif
168 
169  trackindex ->push_back( shallow::findTrackIndex(tracks, track) );
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 );
183  #endif
184  gainused ->push_back( PrevGain );
185  gainusedTick ->push_back( PrevGainTick );
186  }
187  }
188  }
189 
190  iEvent.put(std::move(trackindex), Prefix + "trackindex" + Suffix );
191  iEvent.put(std::move(rawid ), Prefix + "rawid" + Suffix );
192  iEvent.put(std::move(localdirx ), Prefix + "localdirx" + Suffix );
193  iEvent.put(std::move(localdiry ), Prefix + "localdiry" + Suffix );
194  iEvent.put(std::move(localdirz ), Prefix + "localdirz" + Suffix );
195  iEvent.put(std::move(firststrip), Prefix + "firststrip" + Suffix );
196  iEvent.put(std::move(nstrips), Prefix + "nstrips" + Suffix );
197  iEvent.put(std::move(saturation), Prefix + "saturation" + Suffix );
198  iEvent.put(std::move(overlapping), Prefix + "overlapping" + Suffix );
199  iEvent.put(std::move(farfromedge), Prefix + "farfromedge" + Suffix );
200  iEvent.put(std::move(charge), Prefix + "charge" + Suffix );
201  iEvent.put(std::move(path), Prefix + "path" + Suffix );
202  #ifdef ExtendedCALIBTree
203  iEvent.put(std::move(chargeoverpath),Prefix + "chargeoverpath"+ Suffix );
204  #endif
205  iEvent.put(std::move(amplitude), Prefix + "amplitude" + Suffix );
206  iEvent.put(std::move(gainused), Prefix + "gainused" + Suffix );
207  iEvent.put(std::move(gainusedTick), Prefix + "gainusedTick" + Suffix );
208 }
ClusterRef cluster() const
int minPixelCol() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
unsigned int stereoId() const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
int findTrackIndex(const edm::Handle< edm::View< reco::Track > > &h, const reco::Track *t)
Definition: ShallowTools.cc:27
SiStripCluster const & monoCluster() const
LocalVector localDirection() const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
T y() const
Definition: PV3DBase.h:63
uint16_t firstStrip() const
bool IsFarFromBorder(TrajectoryStateOnSurface *trajState, const uint32_t detid, const edm::EventSetup *iSetup)
static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range)
Definition: SiStripGain.h:76
DataContainer const & measurements() const
Definition: Trajectory.h:196
T mag() const
Definition: PV3DBase.h:67
int minPixelRow() const
Definition: Path.h:44
T z() const
Definition: PV3DBase.h:64
ClusterRef cluster() const
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
const std::vector< uint16_t > & pixelADC() const
Definition: DetId.h:18
const TrackerGeometry * m_tracker
ClusterRef cluster() const
Definition: SiPixelRecHit.h:49
SiStripCluster const & stereoCluster() const
const edm::EDGetTokenT< TrajTrackAssociationCollection > association_token_
Pixel cluster – collection of neighboring pixels above threshold.
double a
Definition: hdecay.h:121
T get() const
Definition: EventSetup.h:71
unsigned int monoId() const
const_iterator begin() const
first iterator over the map (read only)
DetId geographicalId() const
bool isValid() const
Definition: ESHandle.h:44
T x() const
Definition: PV3DBase.h:62
const std::vector< uint8_t > & amplitudes() const
def move(src, dest)
Definition: eostools.py:511
Our base class.
Definition: SiPixelRecHit.h:23
const SiStripApvGain::Range getRange(uint32_t detID) const
Definition: SiStripGain.h:71
double ShallowGainCalibration::thickness ( DetId  id)
private

Definition at line 299 of file ShallowGainCalibration.cc.

References triggerObjects_cff::id, TrackerGeometry::idToDetUnit(), fastTrackerRecHitType::isPixel(), m_thicknessMap, and m_tracker.

Referenced by produce().

300 {
301  map<DetId,double>::iterator th=m_thicknessMap.find(id);
302  if(th!=m_thicknessMap.end())
303  return (*th).second;
304  else {
305  double detThickness=1.;
306  //compute thickness normalization
307  const GeomDetUnit* it = m_tracker->idToDetUnit(DetId(id));
308  bool isPixel = dynamic_cast<const PixelGeomDetUnit*>(it)!=nullptr;
309  bool isStrip = dynamic_cast<const StripGeomDetUnit*>(it)!=nullptr;
310  if (!isPixel && ! isStrip) {
311  //FIXME throw exception
312  edm::LogWarning("DeDxHitsProducer") << "\t\t this detID doesn't seem to belong to the Tracker";
313  detThickness = 1.;
314  }else{
315  detThickness = it->surface().bounds().thickness();
316  }
317 
318  m_thicknessMap[id]=detThickness;//computed value
319  return detThickness;
320  }
321 
322 }
std::map< DetId, double > m_thicknessMap
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: DetId.h:18
const TrackerGeometry * m_tracker
bool isPixel(HitType hitType)

Member Data Documentation

const edm::EDGetTokenT< TrajTrackAssociationCollection > ShallowGainCalibration::association_token_
private

Definition at line 63 of file ShallowGainCalibration.h.

Referenced by produce().

std::map<DetId,double> ShallowGainCalibration::m_thicknessMap
private

Definition at line 75 of file ShallowGainCalibration.h.

Referenced by thickness().

const TrackerGeometry* ShallowGainCalibration::m_tracker
private

Definition at line 74 of file ShallowGainCalibration.h.

Referenced by produce(), and thickness().

std::string ShallowGainCalibration::Prefix
private

Definition at line 66 of file ShallowGainCalibration.h.

Referenced by produce(), and ShallowGainCalibration().

std::string ShallowGainCalibration::Suffix
private

Definition at line 65 of file ShallowGainCalibration.h.

Referenced by produce(), and ShallowGainCalibration().

const edm::EDGetTokenT< edm::View<reco::Track> > ShallowGainCalibration::tracks_token_
private

Definition at line 62 of file ShallowGainCalibration.h.

Referenced by produce().