CMS 3D CMS Logo

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

Public Member Functions

 DummyEvelyser (const edm::ParameterSet &)
 
 ~DummyEvelyser () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const 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
 
bool wantsStreamRuns () const
 
 ~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)
 

Protected Member Functions

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

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

const edm::ESGetToken< TGeoManager, DisplayGeomRecordgeomToken_
 
edm::Service< EveServicem_eve
 
TEveElement * m_geomList
 
edm::ESWatcher< DisplayGeomRecordm_geomWatcher
 
TEveTrackList * m_trackList
 
edm::InputTag m_trackTags
 
edm::EDGetTokenT< reco::TrackCollectiontrackCollectionToken_
 

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)
 

Detailed Description

Definition at line 49 of file DummyEvelyser.cc.

Constructor & Destructor Documentation

◆ DummyEvelyser()

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

Definition at line 92 of file DummyEvelyser.cc.

References m_trackTags, and trackCollectionToken_.

93  : m_eve(),
95  m_geomList(nullptr),
96  m_trackList(nullptr),
99  trackCollectionToken_ = consumes<reco::TrackCollection>(m_trackTags);
100 }
edm::Service< EveService > m_eve
TEveElement * m_geomList
T getUntrackedParameter(std::string const &, T const &) const
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
const edm::ESGetToken< TGeoManager, DisplayGeomRecord > geomToken_
edm::EDGetTokenT< reco::TrackCollection > trackCollectionToken_
edm::InputTag m_trackTags
TEveTrackList * m_trackList
void remakeGeometry(const DisplayGeomRecord &dgRec)

◆ ~DummyEvelyser()

DummyEvelyser::~DummyEvelyser ( )
override

Definition at line 102 of file DummyEvelyser.cc.

102 {}

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 187 of file DummyEvelyser.cc.

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(), JetHT_cfg::trackCollection, and trackCollectionToken_.

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 }
edm::Service< EveService > m_eve
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:62
T const * product() const
Definition: Handle.h:70
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
Log< level::Error, false > LogError
int iEvent
Definition: GenABIO.cc:224
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
void display(const std::string &info="")
Definition: EveService.cc:232
trackCollection
Definition: JetHT_cfg.py:51
edm::EDGetTokenT< reco::TrackCollection > trackCollectionToken_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
void AddElement(TEveElement *el)
Definition: EveService.cc:261
TEveTrackList * m_trackList

◆ beginJob()

void DummyEvelyser::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 128 of file DummyEvelyser.cc.

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

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

◆ beginRun()

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

Definition at line 160 of file DummyEvelyser.cc.

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

160  {
161  printf("DummyEvelyser::beginRun\n");
162 
163  if (m_eve) {
164  m_geomList = new TEveElementList("DummyEvelyzer Geom");
166  m_eve->getManager()->GetGlobalScene()->GetGLScene()->SetStyle(TGLRnrCtx::kWireFrame);
167  }
168 }
edm::Service< EveService > m_eve
TEveElement * m_geomList
TEveManager * getManager()
Definition: EveService.cc:249
void AddGlobalElement(TEveElement *el)
Definition: EveService.cc:263

◆ endJob()

void DummyEvelyser::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 149 of file DummyEvelyser.cc.

References m_trackList.

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

◆ endRun()

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

Definition at line 170 of file DummyEvelyser.cc.

170 { 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 108 of file DummyEvelyser.cc.

References m_geomList, and castor_dqm_sourceclient_file_cfg::path.

Referenced by remakeGeometry().

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

◆ remakeGeometry()

void DummyEvelyser::remakeGeometry ( const DisplayGeomRecord dgRec)
private

Definition at line 174 of file DummyEvelyser.cc.

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

174  {
175  m_geomList->DestroyElements();
176 
177  TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(&dgRec.get(geomToken_)));
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 }
TEveElement * m_geomList
const edm::ESGetToken< TGeoManager, DisplayGeomRecord > geomToken_
TEveGeoTopNode * make_node(const TString &path, Int_t vis_level, Bool_t global_cs)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

Member Data Documentation

◆ geomToken_

const edm::ESGetToken<TGeoManager, DisplayGeomRecord> DummyEvelyser::geomToken_
private

Definition at line 73 of file DummyEvelyser.cc.

Referenced by remakeGeometry().

◆ m_eve

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

Definition at line 66 of file DummyEvelyser.cc.

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

◆ m_geomList

TEveElement* DummyEvelyser::m_geomList
private

Definition at line 69 of file DummyEvelyser.cc.

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

◆ m_geomWatcher

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

Definition at line 74 of file DummyEvelyser.cc.

Referenced by analyze().

◆ m_trackList

TEveTrackList* DummyEvelyser::m_trackList
private

Definition at line 70 of file DummyEvelyser.cc.

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

◆ m_trackTags

edm::InputTag DummyEvelyser::m_trackTags
private

Definition at line 68 of file DummyEvelyser.cc.

Referenced by DummyEvelyser().

◆ trackCollectionToken_

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

Definition at line 72 of file DummyEvelyser.cc.

Referenced by analyze(), and DummyEvelyser().