CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
DummyEvelyser Class Reference
Inheritance diagram for DummyEvelyser:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 DummyEvelyser (const edm::ParameterSet &)
 
 ~DummyEvelyser () override
 
- 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
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

Public Attributes

edm::EDGetTokenT< reco::TrackCollectiontrackCollectionToken_
 

Protected Member Functions

TEveGeoTopNode * make_node (const TString &path, Int_t vis_level, Bool_t global_cs)
 
- 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>
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)
 
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)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endJob () override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
void remakeGeometry (const DisplayGeomRecord &dgRec)
 

Private Attributes

edm::Service< EveServicem_eve
 
TEveElement * m_geomList
 
edm::ESWatcher< DisplayGeomRecordm_geomWatcher
 
TEveTrackList * m_trackList
 
edm::InputTag m_trackTags
 

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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Detailed Description

Definition at line 49 of file DummyEvelyser.cc.

Constructor & Destructor Documentation

◆ DummyEvelyser()

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

Definition at line 91 of file DummyEvelyser.cc.

92  : m_eve(),
94  m_geomList(nullptr),
95  m_trackList(nullptr),
97  trackCollectionToken_ = consumes<reco::TrackCollection>(m_trackTags);
98 }

References m_trackTags, and trackCollectionToken_.

◆ ~DummyEvelyser()

DummyEvelyser::~DummyEvelyser ( )
override

Definition at line 100 of file DummyEvelyser.cc.

100 {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 187 of file DummyEvelyser.cc.

187  {
188  printf("DummyEvelyser::analyze\n");
189 
191  iEvent.getByToken(trackCollectionToken_, trackHandle);
192  const reco::TrackCollection trackCollection = *(trackHandle.product());
193  if (!trackHandle.isValid()) {
194  edm::LogError("DummyEvelyser") << "Error! Can't get Track collection " << std::endl;
195  return;
196  }
197 
198  if (m_eve) {
199  // Remake geometry if it has changed.
200  m_geomWatcher.check(iSetup);
201 
202  // Stripped down demo from Tracking twiki.
203 
204  using namespace edm;
205 
206  m_trackList->DestroyElements();
207 
208  // All top-level elements are removed from default event-store at
209  // the end of each event.
211 
212  int cnt = 0;
213 
214  for (auto itTrack = trackCollection.begin(); itTrack != trackCollection.end(); ++itTrack, ++cnt) {
215  TEveTrack* trk = fireworks::prepareTrack(*itTrack, m_trackList->GetPropagator());
216  trk->SetElementName(TString::Format("Track %d", cnt));
217  trk->SetElementTitle(TString::Format("Track %d, pt=%.3f", cnt, itTrack->pt()));
218  trk->MakeTrack();
219 
220  trk->SetAttLineAttMarker(m_trackList);
221  m_trackList->AddElement(trk);
222  }
223 
224  // The display() function runs the GUI event-loop and shows
225  // whatever has been registered so far to eve.
226  // It returns when user presses the "Step" button (or "Continue" or
227  // "Next Event").
228  m_eve->display(Form("DummyEvelyser::analyze done for %d tracks\n", m_trackList->NumChildren()));
229  }
230 }

References EveService::AddElement(), edm::ESWatcher< T >::check(), EveService::display(), iEvent, edm::HandleBase::isValid(), m_eve, m_geomWatcher, m_trackList, fireworks::prepareTrack(), edm::Handle< T >::product(), duplicaterechits_cfi::trackCollection, and trackCollectionToken_.

◆ beginJob()

void DummyEvelyser::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 126 of file DummyEvelyser.cc.

126  {
127  printf("DummyEvelyser::beginJob\n");
128 
129  if (m_eve) {
130  // Make a track-list container we'll hold on until the end of the job.
131  // This allows us to preserve settings done by user via GUI.
132  m_trackList = new TEveTrackList("Tracks");
133  m_trackList->SetMainColor(6);
134  m_trackList->SetMarkerColor(kYellow);
135  m_trackList->SetMarkerStyle(4);
136  m_trackList->SetMarkerSize(0.5);
137 
138  m_trackList->IncDenyDestroy();
139 
140  TEveTrackPropagator* prop = m_trackList->GetPropagator();
141  prop->SetStepper(TEveTrackPropagator::kRungeKutta);
142  // Use simplified magnetic field provided by EveService.
144  }
145 }

References m_eve, m_trackList, and EveService::setupFieldForPropagator().

◆ beginRun()

void DummyEvelyser::beginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 158 of file DummyEvelyser.cc.

158  {
159  printf("DummyEvelyser::beginRun\n");
160 
161  if (m_eve) {
162  m_geomList = new TEveElementList("DummyEvelyzer Geom");
164  m_eve->getManager()->GetGlobalScene()->GetGLScene()->SetStyle(TGLRnrCtx::kWireFrame);
165  }
166 }

References EveService::AddGlobalElement(), EveService::getManager(), m_eve, and m_geomList.

◆ endJob()

void DummyEvelyser::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 147 of file DummyEvelyser.cc.

147  {
148  printf("DummyEvelyser::endJob\n");
149 
150  if (m_trackList) {
151  m_trackList->DecDenyDestroy();
152  m_trackList = nullptr;
153  }
154 }

References m_trackList.

◆ endRun()

void DummyEvelyser::endRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 168 of file DummyEvelyser.cc.

168 { printf("DummyEvelyser::endRun\n"); }

◆ make_node()

TEveGeoTopNode * DummyEvelyser::make_node ( const TString &  path,
Int_t  vis_level,
Bool_t  global_cs 
)
protected

Definition at line 106 of file DummyEvelyser.cc.

106  {
107  if (!gGeoManager->cd(path)) {
108  Warning("make_node", "Path '%s' not found.", path.Data());
109  return nullptr;
110  }
111 
112  TEveGeoTopNode* tn = new TEveGeoTopNode(gGeoManager, gGeoManager->GetCurrentNode());
113  tn->SetVisLevel(vis_level);
114  if (global_cs) {
115  tn->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix());
116  }
117  m_geomList->AddElement(tn);
118 
119  return tn;
120 }

References m_geomList, and castor_dqm_sourceclient_file_cfg::path.

Referenced by remakeGeometry().

◆ remakeGeometry()

void DummyEvelyser::remakeGeometry ( const DisplayGeomRecord dgRec)
private

Definition at line 172 of file DummyEvelyser.cc.

172  {
173  m_geomList->DestroyElements();
174 
176  dgRec.get(geom);
177  TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(geom.product()));
178 
179  // To have a full one, all detectors in one top-node:
180  // make_node("/cms:World_1/cms:CMSE_1", 4, kTRUE);
181 
182  make_node("/cms:World_1/cms:CMSE_1/tracker:Tracker_1", 1, kTRUE);
183  make_node("/cms:World_1/cms:CMSE_1/caloBase:CALO_1", 1, kTRUE);
184  make_node("/cms:World_1/cms:CMSE_1/muonBase:MUON_1", 1, kTRUE);
185 }

References relativeConstraints::geom, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), m_geomList, and make_node().

Member Data Documentation

◆ m_eve

edm::Service<EveService> DummyEvelyser::m_eve
private

Definition at line 67 of file DummyEvelyser.cc.

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

◆ m_geomList

TEveElement* DummyEvelyser::m_geomList
private

Definition at line 70 of file DummyEvelyser.cc.

Referenced by beginRun(), make_node(), and remakeGeometry().

◆ m_geomWatcher

edm::ESWatcher<DisplayGeomRecord> DummyEvelyser::m_geomWatcher
private

Definition at line 73 of file DummyEvelyser.cc.

Referenced by analyze().

◆ m_trackList

TEveTrackList* DummyEvelyser::m_trackList
private

Definition at line 71 of file DummyEvelyser.cc.

Referenced by analyze(), beginJob(), and endJob().

◆ m_trackTags

edm::InputTag DummyEvelyser::m_trackTags
private

Definition at line 69 of file DummyEvelyser.cc.

Referenced by DummyEvelyser().

◆ trackCollectionToken_

edm::EDGetTokenT<reco::TrackCollection> DummyEvelyser::trackCollectionToken_

Definition at line 53 of file DummyEvelyser.cc.

Referenced by analyze(), and DummyEvelyser().

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
DummyEvelyser::m_trackList
TEveTrackList * m_trackList
Definition: DummyEvelyser.cc:71
DummyEvelyser::m_eve
edm::Service< EveService > m_eve
Definition: DummyEvelyser.cc:67
edm::Handle::product
T const * product() const
Definition: Handle.h:70
EveService::setupFieldForPropagator
void setupFieldForPropagator(TEveTrackPropagator *prop)
Definition: EveService.cc:255
edm
HLT enums.
Definition: AlignableModifier.h:19
EveService::AddElement
void AddElement(TEveElement *el)
Definition: EveService.cc:261
DummyEvelyser::m_geomList
TEveElement * m_geomList
Definition: DummyEvelyser.cc:70
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EveService::getManager
TEveManager * getManager()
Definition: EveService.cc:249
edm::Handle< reco::TrackCollection >
EveService::AddGlobalElement
void AddGlobalElement(TEveElement *el)
Definition: EveService.cc:263
DummyEvelyser::remakeGeometry
void remakeGeometry(const DisplayGeomRecord &dgRec)
Definition: DummyEvelyser.cc:172
DummyEvelyser::trackCollectionToken_
edm::EDGetTokenT< reco::TrackCollection > trackCollectionToken_
Definition: DummyEvelyser.cc:53
edm::ESHandle
Definition: DTSurvey.h:22
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
edm::LogError
Definition: MessageLogger.h:183
duplicaterechits_cfi.trackCollection
trackCollection
Definition: duplicaterechits_cfi.py:4
fireworks::prepareTrack
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:62
iEvent
int iEvent
Definition: GenABIO.cc:224
DummyEvelyser::m_geomWatcher
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
Definition: DummyEvelyser.cc:73
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
DummyEvelyser::m_trackTags
edm::InputTag m_trackTags
Definition: DummyEvelyser.cc:69
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
EveService::display
void display(const std::string &info="")
Definition: EveService.cc:232
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
DummyEvelyser::make_node
TEveGeoTopNode * make_node(const TString &path, Int_t vis_level, Bool_t global_cs)
Definition: DummyEvelyser.cc:106