CMS 3D CMS Logo

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

#include <DebugTools/OverlapProblem/plugins/OverlapProblemTSOSAnalyzer.cc>

Inheritance diagram for OverlapProblemTSOSAnalyzer:
edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 OverlapProblemTSOSAnalyzer (const edm::ParameterSet &)
 
 ~OverlapProblemTSOSAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, 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::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 

Private Attributes

const bool m_debug
 
TH1F * m_etatrk
 
TH1F * m_ptrk
 
TSOSHistogramMaker m_tsoshm
 
edm::EDGetTokenT< TrajTrackAssociationCollectionm_ttacollToken
 
bool m_validOnly
 

Additional Inherited Members

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

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 64 of file OverlapProblemTSOSAnalyzer.cc.

Constructor & Destructor Documentation

◆ OverlapProblemTSOSAnalyzer()

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

Definition at line 97 of file OverlapProblemTSOSAnalyzer.cc.

References TFileService::kSharedResource, m_etatrk, m_ptrk, and TFileService::make().

98  : m_validOnly(iConfig.getParameter<bool>("onlyValidRecHit")),
100  consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("trajTrackAssoCollection"))),
101  m_debug(iConfig.getUntrackedParameter<bool>("debugMode", false)),
102  m_tsoshm(iConfig.getParameter<edm::ParameterSet>("tsosHMConf")) {
103  //now do what ever initialization is needed
104  usesResource(TFileService::kSharedResource);
105 
107 
108  m_ptrk = tfserv->make<TH1F>("trkmomentum", "Refitted Track momentum", 100, 0., 200.);
109  m_etatrk = tfserv->make<TH1F>("trketa", "Refitted Track pseudorapidity", 100, -4., 4.);
110 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< TrajTrackAssociationCollection > m_ttacollToken
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64

◆ ~OverlapProblemTSOSAnalyzer()

OverlapProblemTSOSAnalyzer::~OverlapProblemTSOSAnalyzer ( )
override

Definition at line 112 of file OverlapProblemTSOSAnalyzer.cc.

112  {
113  // do anything here that needs to be done at desctruction time
114  // (e.g. close files, deallocate resources etc.)
115 }

Member Function Documentation

◆ analyze()

void OverlapProblemTSOSAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 122 of file OverlapProblemTSOSAnalyzer.cc.

References edm::AssociationMap< Tag >::begin(), SiPixelRecHit::cluster(), edm::AssociationMap< Tag >::end(), TSOSHistogramMaker::fill(), iEvent, edm::Ref< C, T, F >::key(), m_debug, m_etatrk, m_ptrk, m_tsoshm, m_ttacollToken, m_validOnly, and collectionMerger::selector.

122  {
123  using namespace edm;
124 
125  // loop on trajectories and plot TSOS local coordinate
126 
127  TrajectoryStateCombiner tsoscomb;
128 
129  // Trajectory Handle
130 
131  DetIdSelector selector("0x1fbff004-0x14ac1004");
132 
134  iEvent.getByToken(m_ttacollToken, ttac);
135 
136  for (TrajTrackAssociationCollection::const_iterator pair = ttac->begin(); pair != ttac->end(); ++pair) {
137  const edm::Ref<std::vector<Trajectory> >& traj = pair->key;
138  const reco::TrackRef& trk = pair->val;
139  const std::vector<TrajectoryMeasurement>& tmcoll = traj->measurements();
140 
141  m_ptrk->Fill(trk->p());
142  m_etatrk->Fill(trk->eta());
143 
144  for (std::vector<TrajectoryMeasurement>::const_iterator meas = tmcoll.begin(); meas != tmcoll.end(); ++meas) {
145  if (!meas->updatedState().isValid())
146  continue;
147 
148  TrajectoryStateOnSurface tsos = tsoscomb(meas->forwardPredictedState(), meas->backwardPredictedState());
150 
151  m_tsoshm.fill(tsos, hit);
152 
153  if (!hit->isValid() && m_validOnly)
154  continue;
155 
156  if (m_debug) {
157  if (selector.isSelected(hit->geographicalId())) {
158  const SiPixelRecHit* pixelrh = dynamic_cast<const SiPixelRecHit*>(hit->hit());
159  if (pixelrh) {
160  edm::LogInfo("ClusterFound") << "Cluster reference" << pixelrh->cluster().key();
161  } else {
162  edm::LogInfo("NoCluster") << "No cluster found!";
163  }
164  }
165  }
166  }
167  }
168 }
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
key_type key() const
Accessor for product key.
Definition: Ref.h:250
const_iterator end() const
last iterator over the map (read only)
int iEvent
Definition: GenABIO.cc:224
void fill(const TrajectoryStateOnSurface &tsos, TransientTrackingRecHit::ConstRecHitPointer hit) const
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
Log< level::Info, false > LogInfo
edm::EDGetTokenT< TrajTrackAssociationCollection > m_ttacollToken
const_iterator begin() const
first iterator over the map (read only)
HLT enums.
Our base class.
Definition: SiPixelRecHit.h:23

◆ beginRun()

void OverlapProblemTSOSAnalyzer::beginRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivate

Definition at line 170 of file OverlapProblemTSOSAnalyzer.cc.

170 {}

◆ endRun()

void OverlapProblemTSOSAnalyzer::endRun ( const edm::Run iRun,
const edm::EventSetup  
)
overrideprivate

Definition at line 172 of file OverlapProblemTSOSAnalyzer.cc.

172 {}

Member Data Documentation

◆ m_debug

const bool OverlapProblemTSOSAnalyzer::m_debug
private

Definition at line 81 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

◆ m_etatrk

TH1F* OverlapProblemTSOSAnalyzer::m_etatrk
private

Definition at line 77 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze(), and OverlapProblemTSOSAnalyzer().

◆ m_ptrk

TH1F* OverlapProblemTSOSAnalyzer::m_ptrk
private

Definition at line 76 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze(), and OverlapProblemTSOSAnalyzer().

◆ m_tsoshm

TSOSHistogramMaker OverlapProblemTSOSAnalyzer::m_tsoshm
private

Definition at line 83 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

◆ m_ttacollToken

edm::EDGetTokenT<TrajTrackAssociationCollection> OverlapProblemTSOSAnalyzer::m_ttacollToken
private

Definition at line 80 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().

◆ m_validOnly

bool OverlapProblemTSOSAnalyzer::m_validOnly
private

Definition at line 79 of file OverlapProblemTSOSAnalyzer.cc.

Referenced by analyze().