CMS 3D CMS Logo

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

#include <DTSegment4DT0Corrector.h>

Inheritance diagram for DTSegment4DT0Corrector:
edm::stream::EDProducer<>

Public Member Functions

 DTSegment4DT0Corrector (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &event, const edm::EventSetup &setup) override
 The method which produces the 4D rec segments corrected for t0 offset. More...
 
 ~DTSegment4DT0Corrector () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

bool debug
 
edm::EDGetTokenT< DTRecSegment4DCollectionrecHits4DToken_
 
DTSegmentUpdatortheUpdator
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Builds the segments in the DT chambers.

Author
Mario Pelliccioni - INFN Torino pelli.nosp@m.cci@.nosp@m.cern..nosp@m.ch

Definition at line 20 of file DTSegment4DT0Corrector.h.

Constructor & Destructor Documentation

◆ DTSegment4DT0Corrector()

DTSegment4DT0Corrector::DTSegment4DT0Corrector ( const edm::ParameterSet pset)

Constructor.

Definition at line 22 of file DTSegment4DT0Corrector.cc.

22  {
23  produces<DTRecSegment4DCollection>();
24 
25  // debug parameter
26  debug = pset.getUntrackedParameter<bool>("debug");
27 
28  if (debug)
29  cout << "[DTSegment4DT0Corrector] Constructor called" << endl;
30 
31  // the name of the 4D rec hits collection
32  recHits4DToken_ = consumes<DTRecSegment4DCollection>(pset.getParameter<InputTag>("recHits4DLabel"));
33 
34  // the updator
36 }

References gather_cfg::cout, debug, and muonDTDigis_cfi::pset.

◆ ~DTSegment4DT0Corrector()

DTSegment4DT0Corrector::~DTSegment4DT0Corrector ( )
override

Destructor.

Definition at line 39 of file DTSegment4DT0Corrector.cc.

39  {
40  if (debug)
41  cout << "[DTSegment4DT0Corrector] Destructor called" << endl;
42  delete theUpdator;
43 }

References gather_cfg::cout, and debug.

Member Function Documentation

◆ produce()

void DTSegment4DT0Corrector::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

The method which produces the 4D rec segments corrected for t0 offset.

Definition at line 45 of file DTSegment4DT0Corrector.cc.

45  {
46  // Get the 4D Segment from the event
48  event.getByToken(recHits4DToken_, all4DSegments);
49 
50  // get the geometry
51  ESHandle<DTGeometry> theGeom;
52  setup.get<MuonGeometryRecord>().get(theGeom);
53 
54  // Percolate the setup
56 
57  // Create the pointer to the collection which will store the rechits
58  auto segments4DCollection = std::make_unique<DTRecSegment4DCollection>();
59 
60  // Iterate over the input DTSegment4D
62 
63  if (debug)
64  cout << "[DTSegment4DT0Corrector] Starting to loop over segments" << endl;
65 
66  for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId) {
68 
69  // Get the range for the corresponding ChamerId
70  DTRecSegment4DCollection::range range = all4DSegments->get(*chamberId);
71 
72  // Loop over the rechits of this ChamberId
73  for (DTRecSegment4DCollection::const_iterator segment4D = range.first; segment4D != range.second; ++segment4D) {
74  DTRecSegment4D tmpseg = *segment4D;
75 
76  DTRecSegment4D* newSeg = tmpseg.clone();
77 
78  if (newSeg == nullptr)
79  continue;
80 
81  theUpdator->update(newSeg, true, false);
82  result.push_back(*newSeg);
83  }
84 
85  segments4DCollection->put(*chamberId, result.begin(), result.end());
86  }
87 
88  if (debug)
89  cout << "[DTSegment4DT0Corrector] Saving modified segments into the event" << endl;
90 
91  // Load the output in the Event
92  event.put(std::move(segments4DCollection));
93 }

References DTRecSegment4D::clone(), gather_cfg::cout, debug, edm::get(), eostools::move(), FastTimerService_cff::range, mps_fire::result, and singleTopDQM_cfi::setup.

Member Data Documentation

◆ debug

bool DTSegment4DT0Corrector::debug
private

◆ recHits4DToken_

edm::EDGetTokenT<DTRecSegment4DCollection> DTSegment4DT0Corrector::recHits4DToken_
private

Definition at line 38 of file DTSegment4DT0Corrector.h.

◆ theUpdator

DTSegmentUpdator* DTSegment4DT0Corrector::theUpdator
private

Definition at line 41 of file DTSegment4DT0Corrector.h.

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
DTSegment4DT0Corrector::theUpdator
DTSegmentUpdator * theUpdator
Definition: DTSegment4DT0Corrector.h:41
DTRecSegment4D
Definition: DTRecSegment4D.h:23
DTRecSegment4D::clone
DTRecSegment4D * clone() const override
Definition: DTRecSegment4D.h:46
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTSegment4DT0Corrector::recHits4DToken_
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
Definition: DTSegment4DT0Corrector.h:38
edm::Handle< DTRecSegment4DCollection >
edm::RangeMap::id_iterator
identifier iterator
Definition: RangeMap.h:130
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
DTSegmentUpdator
Definition: DTSegmentUpdator.h:43
edm::ESHandle< DTGeometry >
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
DTSegmentUpdator::setES
void setES(const edm::EventSetup &setup)
set the setup
Definition: DTSegmentUpdator.cc:68
get
#define get
edm::RangeMap::range
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
eostools.move
def move(src, dest)
Definition: eostools.py:511
DTSegment4DT0Corrector::debug
bool debug
Definition: DTSegment4DT0Corrector.h:36
mps_fire.result
result
Definition: mps_fire.py:311
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::OwnVector
Definition: OwnVector.h:24
DTSegmentUpdator::update
void update(DTRecSegment4D *seg, const bool calcT0, bool allow3par) const
recompute hits position and refit the segment4D
Definition: DTSegmentUpdator.cc:73