CMS 3D CMS Logo

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

#include <DTResidualCalibration.h>

Inheritance diagram for DTResidualCalibration:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 DTResidualCalibration (const edm::ParameterSet &pset)
 Constructor. More...
 
void endJob () override
 
 ~DTResidualCalibration () override
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void bookHistos (DTLayerId slId)
 
void bookHistos (DTSuperLayerId slId)
 
void fillHistos (DTLayerId slId, float distance, float residualOnDistance)
 
void fillHistos (DTSuperLayerId slId, float distance, float residualOnDistance)
 
float segmentToWireDistance (const DTRecHit1D &recHit1D, const DTRecSegment4D &segment)
 

Private Attributes

bool detailedAnalysis_
 
const DTGeometrydtGeom_
 
std::map< DTLayerId, TH1F * > histoMapPerLayerTH1F_
 
std::map< DTLayerId, TH2F * > histoMapPerLayerTH2F_
 
std::map< DTSuperLayerId, TH1F * > histoMapTH1F_
 
std::map< DTSuperLayerId, TH2F * > histoMapTH2F_
 
double histRange_
 
unsigned int nevent
 
std::string rootBaseDir_
 
TFile * rootFile_
 
unsigned int segmbad
 
edm::InputTag segment4DLabel_
 
unsigned int segmok
 
DTSegmentSelectorselect_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Extracts DT segment residuals

Definition at line 28 of file DTResidualCalibration.h.

Constructor & Destructor Documentation

◆ DTResidualCalibration()

DTResidualCalibration::DTResidualCalibration ( const edm::ParameterSet pset)

Constructor.

Definition at line 34 of file DTResidualCalibration.cc.

35  : histRange_(pset.getParameter<double>("histogramRange")),
36  segment4DLabel_(pset.getParameter<edm::InputTag>("segment4DLabel")),
37  rootBaseDir_(pset.getUntrackedParameter<std::string>("rootBaseDir", "DT/Residuals")),
38  detailedAnalysis_(pset.getUntrackedParameter<bool>("detailedAnalysis", false)) {
40  select_ = new DTSegmentSelector(pset, collector);
41 
42  LogDebug("Calibration") << "[DTResidualCalibration] Constructor called.";
43  consumes<DTRecSegment4DCollection>(edm::InputTag(segment4DLabel_));
44  std::string rootFileName = pset.getUntrackedParameter<std::string>("rootFileName", "residuals.root");
45  rootFile_ = new TFile(rootFileName.c_str(), "RECREATE");
46  rootFile_->cd();
47 
48  segmok = 0;
49  segmbad = 0;
50  nevent = 0;
51 }

References edm::EDConsumerBase::consumesCollector(), LogDebug, nevent, muonDTDigis_cfi::pset, rootFile_, CSCSkim_cfi::rootFileName, segmbad, segment4DLabel_, segmok, select_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~DTResidualCalibration()

DTResidualCalibration::~DTResidualCalibration ( )
override

Destructor.

Definition at line 53 of file DTResidualCalibration.cc.

53  {
54  delete select_;
55  edm::LogVerbatim("Calibration") << "[DTResidualCalibration] Destructor called.";
56  edm::LogVerbatim("Calibration") << "[DTResidualCalibration] Analyzed events: " << nevent;
57  edm::LogVerbatim("Calibration") << "[DTResidualCalibration] Good segments: " << segmok;
58  edm::LogVerbatim("Calibration") << "[DTResidualCalibration] Bad segments: " << segmbad;
59 }

References nevent, segmbad, segmok, and select_.

Member Function Documentation

◆ analyze()

void DTResidualCalibration::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 87 of file DTResidualCalibration.cc.

87  {
88  rootFile_->cd();
89  ++nevent;
90 
91  // Get the 4D rechits from the event
93  event.getByLabel(segment4DLabel_, segments4D);
94 
95  // Loop over segments by chamber
97  for (chamberIdIt = segments4D->id_begin(); chamberIdIt != segments4D->id_end(); ++chamberIdIt) {
98  const DTChamber* chamber = dtGeom_->chamber(*chamberIdIt);
99 
100  // Get the range for the corresponding ChamberId
101  DTRecSegment4DCollection::range range = segments4D->get((*chamberIdIt));
102  // Loop over the rechits of this DetUnit
103  for (DTRecSegment4DCollection::const_iterator segment = range.first; segment != range.second; ++segment) {
104  LogTrace("Calibration") << "Segment local pos (in chamber RF): " << (*segment).localPosition()
105  << "\nSegment global pos: " << chamber->toGlobal((*segment).localPosition());
106 
107  if (!(*select_)(*segment, event, setup)) {
108  segmbad++;
109  continue;
110  }
111  segmok++;
112 
113  // Get all 1D RecHits at step 3 within the 4D segment
114  std::vector<DTRecHit1D> recHits1D_S3;
115 
116  if ((*segment).hasPhi()) {
117  const DTChamberRecSegment2D* phiSeg = (*segment).phiSegment();
118  const std::vector<DTRecHit1D>& phiRecHits = phiSeg->specificRecHits();
119  std::copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D_S3));
120  }
121 
122  if ((*segment).hasZed()) {
123  const DTSLRecSegment2D* zSeg = (*segment).zSegment();
124  const std::vector<DTRecHit1D>& zRecHits = zSeg->specificRecHits();
125  std::copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D_S3));
126  }
127 
128  // Loop over 1D RecHit inside 4D segment
129  for (std::vector<DTRecHit1D>::const_iterator recHit1D = recHits1D_S3.begin(); recHit1D != recHits1D_S3.end();
130  ++recHit1D) {
131  const DTWireId wireId = recHit1D->wireId();
132 
133  float segmDistance = segmentToWireDistance(*recHit1D, *segment);
134  if (segmDistance > 2.1)
135  LogTrace("Calibration") << "WARNING: segment-wire distance: " << segmDistance;
136  else
137  LogTrace("Calibration") << "segment-wire distance: " << segmDistance;
138 
139  float residualOnDistance = DTRecHitSegmentResidual().compute(dtGeom_, *recHit1D, *segment);
140  LogTrace("Calibration") << "Wire Id " << wireId << " residual on distance: " << residualOnDistance;
141 
142  fillHistos(wireId.superlayerId(), segmDistance, residualOnDistance);
143  if (detailedAnalysis_)
144  fillHistos(wireId.layerId(), segmDistance, residualOnDistance);
145  }
146  }
147  }
148 }

References relativeConstraints::chamber, DTGeometry::chamber(), DTRecHitSegmentResidual::compute(), filterCSVwithJSON::copy, detailedAnalysis_, dtGeom_, edmPickEvents::event, fillHistos(), DTWireId::layerId(), LogTrace, nevent, FastTimerService_cff::range, rootFile_, segmbad, segment4DLabel_, segmentToWireDistance(), segmok, select_, singleTopDQM_cfi::setup, DTRecSegment2D::specificRecHits(), and DTLayerId::superlayerId().

◆ beginJob()

void DTResidualCalibration::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 61 of file DTResidualCalibration.cc.

61 { TH1::SetDefaultSumw2(true); }

◆ beginRun()

void DTResidualCalibration::beginRun ( const edm::Run run,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 63 of file DTResidualCalibration.cc.

63  {
64  // get the geometry
66  setup.get<MuonGeometryRecord>().get(dtGeomH);
67  dtGeom_ = dtGeomH.product();
68 
69  // Loop over all the chambers
70  if (histoMapTH1F_.empty()) {
71  for (auto ch_it : dtGeom_->chambers()) {
72  // Loop over the SLs
73  for (auto sl_it : ch_it->superLayers()) {
74  DTSuperLayerId slId = (sl_it)->id();
75  bookHistos(slId);
76  if (detailedAnalysis_) {
77  for (auto layer_it : (sl_it)->layers()) {
78  DTLayerId layerId = (layer_it)->id();
79  bookHistos(layerId);
80  }
81  }
82  }
83  }
84  }
85 }

References bookHistos(), DTGeometry::chambers(), detailedAnalysis_, dtGeom_, get, histoMapTH1F_, hgcalTopologyTester_cfi::layers, edm::ESHandle< T >::product(), and singleTopDQM_cfi::setup.

◆ bookHistos() [1/2]

void DTResidualCalibration::bookHistos ( DTLayerId  slId)
private

Definition at line 252 of file DTResidualCalibration.cc.

252  {
253  TH1AddDirectorySentry addDir;
254  rootFile_->cd();
255 
256  LogDebug("Calibration") << "[DTResidualCalibration] Booking histos for layer: " << layerId;
257 
258  // Compose the chamber name
259  std::string wheelStr = std::to_string(layerId.wheel());
260  std::string stationStr = std::to_string(layerId.station());
261  std::string sectorStr = std::to_string(layerId.sector());
262  std::string superLayerStr = std::to_string(layerId.superlayer());
263  std::string layerStr = std::to_string(layerId.layer());
264  // Define the step
265  int step = 3;
266 
267  std::string layerHistoName = "_STEP" + std::to_string(step) + "_W" + wheelStr + "_St" + stationStr + "_Sec" +
268  sectorStr + "_SL" + superLayerStr + "_Layer" + layerStr;
269 
270  LogDebug("Calibration") << "Accessing " << rootBaseDir_;
271  TDirectory* baseDir = rootFile_->GetDirectory(rootBaseDir_.c_str());
272  if (!baseDir)
273  baseDir = rootFile_->mkdir(rootBaseDir_.c_str());
274  LogDebug("Calibration") << "Accessing " << ("Wheel" + wheelStr);
275  TDirectory* wheelDir = baseDir->GetDirectory(("Wheel" + wheelStr).c_str());
276  if (!wheelDir)
277  wheelDir = baseDir->mkdir(("Wheel" + wheelStr).c_str());
278  LogDebug("Calibration") << "Accessing " << ("Station" + stationStr);
279  TDirectory* stationDir = wheelDir->GetDirectory(("Station" + stationStr).c_str());
280  if (!stationDir)
281  stationDir = wheelDir->mkdir(("Station" + stationStr).c_str());
282  LogDebug("Calibration") << "Accessing " << ("Sector" + sectorStr);
283  TDirectory* sectorDir = stationDir->GetDirectory(("Sector" + sectorStr).c_str());
284  if (!sectorDir)
285  sectorDir = stationDir->mkdir(("Sector" + sectorStr).c_str());
286  LogDebug("Calibration") << "Accessing " << ("SL" + superLayerStr);
287  TDirectory* superLayerDir = sectorDir->GetDirectory(("SL" + superLayerStr).c_str());
288  if (!superLayerDir)
289  superLayerDir = sectorDir->mkdir(("SL" + superLayerStr).c_str());
290 
291  superLayerDir->cd();
292  // Create histograms
293  TH1F* histosTH1F = new TH1F(("hResDist" + layerHistoName).c_str(),
294  "Residuals on the distance from wire (rec_hit - segm_extr) (cm)",
295  200,
296  -histRange_,
297  histRange_);
298  TH2F* histosTH2F = new TH2F(("hResDistVsDist" + layerHistoName).c_str(),
299  "Residuals on the dist. (cm) from wire (rec_hit - segm_extr) vs dist. (cm)",
300  100,
301  0,
302  2.5,
303  200,
304  -histRange_,
305  histRange_);
306  histoMapPerLayerTH1F_[layerId] = histosTH1F;
307  histoMapPerLayerTH2F_[layerId] = histosTH2F;
308 }

References ALCARECODTCalibSynchDQM_cff::baseDir, histoMapPerLayerTH1F_, histoMapPerLayerTH2F_, histRange_, DTLayerId::layer(), LogDebug, rootBaseDir_, rootFile_, DTChamberId::sector(), DTChamberId::station(), AlCaHLTBitMon_QueryRunRegistry::string, DTSuperLayerId::superlayer(), and DTChamberId::wheel().

◆ bookHistos() [2/2]

void DTResidualCalibration::bookHistos ( DTSuperLayerId  slId)
private

Definition at line 198 of file DTResidualCalibration.cc.

198  {
199  TH1AddDirectorySentry addDir;
200  rootFile_->cd();
201 
202  LogDebug("Calibration") << "[DTResidualCalibration] Booking histos for SL: " << slId;
203 
204  // Compose the chamber name
205  // Define the step
206  int step = 3;
207 
208  std::string wheelStr = std::to_string(slId.wheel());
209  std::string stationStr = std::to_string(slId.station());
210  std::string sectorStr = std::to_string(slId.sector());
211 
212  std::string slHistoName = "_STEP" + std::to_string(step) + "_W" + wheelStr + "_St" + stationStr + "_Sec" + sectorStr +
213  "_SL" + std::to_string(slId.superlayer());
214 
215  LogDebug("Calibration") << "Accessing " << rootBaseDir_;
216  TDirectory* baseDir = rootFile_->GetDirectory(rootBaseDir_.c_str());
217  if (!baseDir)
218  baseDir = rootFile_->mkdir(rootBaseDir_.c_str());
219  LogDebug("Calibration") << "Accessing " << ("Wheel" + wheelStr);
220  TDirectory* wheelDir = baseDir->GetDirectory(("Wheel" + wheelStr).c_str());
221  if (!wheelDir)
222  wheelDir = baseDir->mkdir(("Wheel" + wheelStr).c_str());
223  LogDebug("Calibration") << "Accessing " << ("Station" + stationStr);
224  TDirectory* stationDir = wheelDir->GetDirectory(("Station" + stationStr).c_str());
225  if (!stationDir)
226  stationDir = wheelDir->mkdir(("Station" + stationStr).c_str());
227  LogDebug("Calibration") << "Accessing " << ("Sector" + sectorStr);
228  TDirectory* sectorDir = stationDir->GetDirectory(("Sector" + sectorStr).c_str());
229  if (!sectorDir)
230  sectorDir = stationDir->mkdir(("Sector" + sectorStr).c_str());
231 
232  sectorDir->cd();
233 
234  // Create the monitor elements
235  TH1F* histosTH1F = new TH1F(("hResDist" + slHistoName).c_str(),
236  "Residuals on the distance from wire (rec_hit - segm_extr) (cm)",
237  200,
238  -histRange_,
239  histRange_);
240  TH2F* histosTH2F = new TH2F(("hResDistVsDist" + slHistoName).c_str(),
241  "Residuals on the dist. (cm) from wire (rec_hit - segm_extr) vs dist. (cm)",
242  100,
243  0,
244  2.5,
245  200,
246  -histRange_,
247  histRange_);
248  histoMapTH1F_[slId] = histosTH1F;
249  histoMapTH2F_[slId] = histosTH2F;
250 }

References ALCARECODTCalibSynchDQM_cff::baseDir, histoMapTH1F_, histoMapTH2F_, histRange_, LogDebug, rootBaseDir_, rootFile_, DTChamberId::sector(), DTChamberId::station(), AlCaHLTBitMon_QueryRunRegistry::string, DTSuperLayerId::superlayer(), and DTChamberId::wheel().

Referenced by beginRun().

◆ endJob()

void DTResidualCalibration::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 179 of file DTResidualCalibration.cc.

179  {
180  LogDebug("Calibration") << "[DTResidualCalibration] Writing histos to file.";
181  rootFile_->cd();
182  rootFile_->Write();
183  rootFile_->Close();
184 
185  /*std::map<DTSuperLayerId, TH1F* >::const_iterator itSlHistos = histoMapTH1F_.begin();
186  std::map<DTSuperLayerId, TH1F* >::const_iterator itSlHistos_end = histoMapTH1F_.end();
187  for(; itSlHistos != itSlHistos_end; ++itSlHistos){
188  std::vector<TH1F*>::const_iterator itHistTH1F = (*itSlHistos).second.begin();
189  std::vector<TH1F*>::const_iterator itHistTH1F_end = (*itSlHistos).second.end();
190  for(; itHistTH1F != itHistTH1F_end; ++itHistTH1F) (*itHistTH1F)->Write();
191 
192  std::vector<TH2F*>::const_iterator itHistTH2F = histoMapTH2F_[(*itSlHistos).first].begin();
193  std::vector<TH2F*>::const_iterator itHistTH2F_end = histoMapTH2F_[(*itSlHistos).first].end();
194  for(; itHistTH2F != itHistTH2F_end; ++itHistTH2F) (*itHistTH2F)->Write();
195  }*/
196 }

References LogDebug, and rootFile_.

Referenced by o2olib.O2ORunMgr::executeJob().

◆ fillHistos() [1/2]

void DTResidualCalibration::fillHistos ( DTLayerId  slId,
float  distance,
float  residualOnDistance 
)
private

Definition at line 317 of file DTResidualCalibration.cc.

317  {
318  histoMapPerLayerTH1F_[layerId]->Fill(residualOnDistance);
319  histoMapPerLayerTH2F_[layerId]->Fill(distance, residualOnDistance);
320 }

References HLT_FULL_cff::distance, histoMapPerLayerTH1F_, and histoMapPerLayerTH2F_.

◆ fillHistos() [2/2]

void DTResidualCalibration::fillHistos ( DTSuperLayerId  slId,
float  distance,
float  residualOnDistance 
)
private

Definition at line 311 of file DTResidualCalibration.cc.

311  {
312  histoMapTH1F_[slId]->Fill(residualOnDistance);
313  histoMapTH2F_[slId]->Fill(distance, residualOnDistance);
314 }

References HLT_FULL_cff::distance, histoMapTH1F_, and histoMapTH2F_.

Referenced by analyze().

◆ segmentToWireDistance()

float DTResidualCalibration::segmentToWireDistance ( const DTRecHit1D recHit1D,
const DTRecSegment4D segment 
)
private

Definition at line 150 of file DTResidualCalibration.cc.

150  {
151  // Get the layer and the wire position
152  const DTWireId wireId = recHit1D.wireId();
153  const DTLayer* layer = dtGeom_->layer(wireId);
154  float wireX = layer->specificTopology().wirePosition(wireId.wire());
155 
156  // Extrapolate the segment to the z of the wire
157  // Get wire position in chamber RF
158  // (y and z must be those of the hit to be coherent in the transf. of RF in case of rotations of the layer alignment)
159  LocalPoint wirePosInLay(wireX, recHit1D.localPosition().y(), recHit1D.localPosition().z());
160  GlobalPoint wirePosGlob = layer->toGlobal(wirePosInLay);
161  const DTChamber* chamber = dtGeom_->chamber(wireId.layerId().chamberId());
162  LocalPoint wirePosInChamber = chamber->toLocal(wirePosGlob);
163 
164  // Segment position at Wire z in chamber local frame
165  LocalPoint segPosAtZWire =
166  segment.localPosition() + segment.localDirection() * wirePosInChamber.z() / cos(segment.localDirection().theta());
167 
168  // Compute the distance of the segment from the wire
169  int sl = wireId.superlayer();
170  float segmDistance = -1;
171  if (sl == 1 || sl == 3)
172  segmDistance = fabs(wirePosInChamber.x() - segPosAtZWire.x());
173  else if (sl == 2)
174  segmDistance = fabs(segPosAtZWire.y() - wirePosInChamber.y());
175 
176  return segmDistance;
177 }

References relativeConstraints::chamber, DTGeometry::chamber(), DTSuperLayerId::chamberId(), funct::cos(), dtGeom_, DTGeometry::layer(), phase1PixelTopology::layer, DTWireId::layerId(), DTRecSegment4D::localDirection(), DTRecHit1D::localPosition(), DTRecSegment4D::localPosition(), DTSuperLayerId::superlayer(), PV3DBase< T, PVType, FrameType >::theta(), DTWireId::wire(), DTRecHit1D::wireId(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by analyze().

Member Data Documentation

◆ detailedAnalysis_

bool DTResidualCalibration::detailedAnalysis_
private

Definition at line 58 of file DTResidualCalibration.h.

Referenced by analyze(), and beginRun().

◆ dtGeom_

const DTGeometry* DTResidualCalibration::dtGeom_
private

Definition at line 61 of file DTResidualCalibration.h.

Referenced by analyze(), beginRun(), and segmentToWireDistance().

◆ histoMapPerLayerTH1F_

std::map<DTLayerId, TH1F*> DTResidualCalibration::histoMapPerLayerTH1F_
private

Definition at line 66 of file DTResidualCalibration.h.

Referenced by bookHistos(), and fillHistos().

◆ histoMapPerLayerTH2F_

std::map<DTLayerId, TH2F*> DTResidualCalibration::histoMapPerLayerTH2F_
private

Definition at line 67 of file DTResidualCalibration.h.

Referenced by bookHistos(), and fillHistos().

◆ histoMapTH1F_

std::map<DTSuperLayerId, TH1F*> DTResidualCalibration::histoMapTH1F_
private

Definition at line 63 of file DTResidualCalibration.h.

Referenced by beginRun(), bookHistos(), and fillHistos().

◆ histoMapTH2F_

std::map<DTSuperLayerId, TH2F*> DTResidualCalibration::histoMapTH2F_
private

Definition at line 64 of file DTResidualCalibration.h.

Referenced by bookHistos(), and fillHistos().

◆ histRange_

double DTResidualCalibration::histRange_
private

Definition at line 54 of file DTResidualCalibration.h.

Referenced by bookHistos().

◆ nevent

unsigned int DTResidualCalibration::nevent
private

Definition at line 42 of file DTResidualCalibration.h.

Referenced by analyze(), DTResidualCalibration(), and ~DTResidualCalibration().

◆ rootBaseDir_

std::string DTResidualCalibration::rootBaseDir_
private

Definition at line 56 of file DTResidualCalibration.h.

Referenced by bookHistos().

◆ rootFile_

TFile* DTResidualCalibration::rootFile_
private

Definition at line 59 of file DTResidualCalibration.h.

Referenced by analyze(), bookHistos(), DTResidualCalibration(), and endJob().

◆ segmbad

unsigned int DTResidualCalibration::segmbad
private

Definition at line 43 of file DTResidualCalibration.h.

Referenced by analyze(), DTResidualCalibration(), and ~DTResidualCalibration().

◆ segment4DLabel_

edm::InputTag DTResidualCalibration::segment4DLabel_
private

Definition at line 55 of file DTResidualCalibration.h.

Referenced by analyze(), and DTResidualCalibration().

◆ segmok

unsigned int DTResidualCalibration::segmok
private

Definition at line 43 of file DTResidualCalibration.h.

Referenced by analyze(), DTResidualCalibration(), and ~DTResidualCalibration().

◆ select_

DTSegmentSelector* DTResidualCalibration::select_
private

Definition at line 53 of file DTResidualCalibration.h.

Referenced by analyze(), DTResidualCalibration(), and ~DTResidualCalibration().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
DTSLRecSegment2D
Definition: DTSLRecSegment2D.h:15
DTSuperLayerId
Definition: DTSuperLayerId.h:12
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
DTWireId::wire
int wire() const
Return the wire number.
Definition: DTWireId.h:42
DTRecSegment4D::localDirection
LocalVector localDirection() const override
Local direction in Chamber frame.
Definition: DTRecSegment4D.h:67
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
step
step
Definition: StallMonitor.cc:94
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
DTResidualCalibration::histoMapPerLayerTH1F_
std::map< DTLayerId, TH1F * > histoMapPerLayerTH1F_
Definition: DTResidualCalibration.h:66
DTResidualCalibration::nevent
unsigned int nevent
Definition: DTResidualCalibration.h:42
DTResidualCalibration::histoMapTH2F_
std::map< DTSuperLayerId, TH2F * > histoMapTH2F_
Definition: DTResidualCalibration.h:64
DTChamber
Definition: DTChamber.h:24
DTResidualCalibration::bookHistos
void bookHistos(DTSuperLayerId slId)
Definition: DTResidualCalibration.cc:198
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:47
ALCARECODTCalibSynchDQM_cff.baseDir
baseDir
Definition: ALCARECODTCalibSynchDQM_cff.py:16
DTSuperLayerId::superlayer
int superlayer() const
Return the superlayer number (deprecated method name)
Definition: DTSuperLayerId.h:42
DTRecHitSegmentResidual::compute
float compute(const DTGeometry *, const DTRecHit1D &, const DTRecSegment4D &)
Definition: DTRecHitSegmentResidual.cc:17
DTResidualCalibration::dtGeom_
const DTGeometry * dtGeom_
Definition: DTResidualCalibration.h:61
edm::Handle< DTRecSegment4DCollection >
edm::RangeMap::id_iterator
identifier iterator
Definition: RangeMap.h:130
DTRecSegment4D::localPosition
LocalPoint localPosition() const override
Local position in Chamber frame.
Definition: DTRecSegment4D.h:61
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
DTResidualCalibration::histRange_
double histRange_
Definition: DTResidualCalibration.h:54
DTGeometry::chamber
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:90
DTRecHitSegmentResidual
Definition: DTRecHitSegmentResidual.h:12
DTResidualCalibration::select_
DTSegmentSelector * select_
Definition: DTResidualCalibration.h:53
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
DTRecHit1D::wireId
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:76
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DTResidualCalibration::detailedAnalysis_
bool detailedAnalysis_
Definition: DTResidualCalibration.h:58
DTWireId
Definition: DTWireId.h:12
DTGeometry::chambers
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
edm::ESHandle< DTGeometry >
Point3DBase< float, LocalTag >
DTSegmentSelector
Definition: DTSegmentSelector.h:24
DTLayerId
Definition: DTLayerId.h:12
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
DTResidualCalibration::segmok
unsigned int segmok
Definition: DTResidualCalibration.h:43
DTRecHit1D::localPosition
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47
DTResidualCalibration::histoMapTH1F_
std::map< DTSuperLayerId, TH1F * > histoMapTH1F_
Definition: DTResidualCalibration.h:63
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
DTSuperLayerId::chamberId
DTChamberId chamberId() const
Return the corresponding ChamberId.
Definition: DTSuperLayerId.h:45
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
DTResidualCalibration::rootFile_
TFile * rootFile_
Definition: DTResidualCalibration.h:59
edmPickEvents.event
event
Definition: edmPickEvents.py:273
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
DTResidualCalibration::segment4DLabel_
edm::InputTag segment4DLabel_
Definition: DTResidualCalibration.h:55
DTChamberRecSegment2D
Definition: DTChamberRecSegment2D.h:31
DTResidualCalibration::fillHistos
void fillHistos(DTSuperLayerId slId, float distance, float residualOnDistance)
Definition: DTResidualCalibration.cc:311
DTResidualCalibration::segmbad
unsigned int segmbad
Definition: DTResidualCalibration.h:43
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DTLayer
Definition: DTLayer.h:25
DTResidualCalibration::rootBaseDir_
std::string rootBaseDir_
Definition: DTResidualCalibration.h:56
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
edm::RangeMap::range
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
DTResidualCalibration::histoMapPerLayerTH2F_
std::map< DTLayerId, TH2F * > histoMapPerLayerTH2F_
Definition: DTResidualCalibration.h:67
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
DTLayerId::superlayerId
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:45
DTRecSegment2D::specificRecHits
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
Definition: DTRecSegment2D.cc:104
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
CSCSkim_cfi.rootFileName
rootFileName
Definition: CSCSkim_cfi.py:9
DTWireId::layerId
DTLayerId layerId() const
Return the corresponding LayerId.
Definition: DTWireId.h:45
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
TH1AddDirectorySentry
Definition: TH1AddDirectorySentry.h:24
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7746
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
DTResidualCalibration::segmentToWireDistance
float segmentToWireDistance(const DTRecHit1D &recHit1D, const DTRecSegment4D &segment)
Definition: DTResidualCalibration.cc:150
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27