CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | 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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void beginJob () override
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void endJob () override
 
virtual 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
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 48 of file DummyEvelyser.cc.

Constructor & Destructor Documentation

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

Definition at line 93 of file DummyEvelyser.cc.

93  :
94  m_eve(),
96  m_geomList(0),
97  m_trackList(0),
99 {}
T getUntrackedParameter(std::string const &, T const &) const
edm::Service< EveService > m_eve
TEveElement * m_geomList
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
edm::InputTag m_trackTags
TEveTrackList * m_trackList
void remakeGeometry(const DisplayGeomRecord &dgRec)
DummyEvelyser::~DummyEvelyser ( )

Definition at line 101 of file DummyEvelyser.cc.

102 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 204 of file DummyEvelyser.cc.

References EveService::AddElement(), edm::ESWatcher< T >::check(), EveService::display(), edm::Event::getByLabel(), m_eve, m_geomWatcher, m_trackList, m_trackTags, fireworks::prepareTrack(), AlCaHLTBitMon_QueryRunRegistry::string, and testEve_cfg::tracks.

205 {
206  printf("DummyEvelyser::analyze\n");
207 
208  if (m_eve)
209  {
210  // Remake geometry if it has changed.
211  m_geomWatcher.check(iSetup);
212 
213 
214  // Stripped down demo from Tracking twiki.
215 
216  using namespace edm;
217 
219  iEvent.getByLabel(m_trackTags, tracks);
220 
221  m_trackList->DestroyElements();
222 
223  // All top-level elements are removed from default event-store at
224  // the end of each event.
226 
227  int cnt = 0;
228  for (View<reco::Track>::const_iterator itTrack = tracks->begin();
229  itTrack != tracks->end(); ++itTrack, ++cnt)
230  {
231  TEveTrack* trk = fireworks::prepareTrack(*itTrack, m_trackList->GetPropagator());
232  trk->SetElementName (TString::Format("Track %d", cnt));
233  trk->SetElementTitle(TString::Format("Track %d, pt=%.3f", cnt, itTrack->pt()));
234  trk->MakeTrack();
235  trk->SetAttLineAttMarker(m_trackList);
236  m_trackList->AddElement(trk);
237 
238  // The display() function runs the GUI event-loop and shows
239  // whatever has been registered so far to eve.
240  // It returns when user presses the "Step" button (or "Continue" or
241  // "Next Event").
242  m_eve->display(std::string("DummyEvelyser::analyze done for:\n") + trk->GetName());
243  }
244  }
245 }
edm::Service< EveService > m_eve
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:73
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
void display(const std::string &info="")
Definition: EveService.cc:261
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:405
tuple tracks
Definition: testEve_cfg.py:39
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
edm::InputTag m_trackTags
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
void AddElement(TEveElement *el)
Definition: EveService.cc:299
TEveTrackList * m_trackList
void DummyEvelyser::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 133 of file DummyEvelyser.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 169 of file DummyEvelyser.cc.

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

170 {
171  printf("DummyEvelyser::beginRun\n");
172 
173  if (m_eve)
174  {
175  m_geomList = new TEveElementList("DummyEvelyzer Geom");
177  m_eve->getManager()->GetGlobalScene()->GetGLScene()->SetStyle(TGLRnrCtx::kWireFrame);
178  }
179 }
edm::Service< EveService > m_eve
TEveElement * m_geomList
TEveManager * getManager()
Definition: EveService.cc:280
void AddGlobalElement(TEveElement *el)
Definition: EveService.cc:304
void DummyEvelyser::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 156 of file DummyEvelyser.cc.

References m_trackList.

157 {
158  printf("DummyEvelyser::endJob\n");
159 
160  if (m_trackList)
161  {
162  m_trackList->DecDenyDestroy();
163  m_trackList = 0;
164  }
165 }
TEveTrackList * m_trackList
void DummyEvelyser::endRun ( const edm::Run ,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 181 of file DummyEvelyser.cc.

182 {
183  printf("DummyEvelyser::endRun\n");
184 }
TEveGeoTopNode * DummyEvelyser::make_node ( const TString &  path,
Int_t  vis_level,
Bool_t  global_cs 
)
protected

Definition at line 109 of file DummyEvelyser.cc.

References m_geomList.

Referenced by remakeGeometry().

110 {
111  if (! gGeoManager->cd(path))
112  {
113  Warning("make_node", "Path '%s' not found.", path.Data());
114  return 0;
115  }
116 
117  TEveGeoTopNode* tn = new TEveGeoTopNode(gGeoManager, gGeoManager->GetCurrentNode());
118  tn->SetVisLevel(vis_level);
119  if (global_cs)
120  {
121  tn->RefMainTrans().SetFrom(*gGeoManager->GetCurrentMatrix());
122  }
123  m_geomList->AddElement(tn);
124 
125  return tn;
126 }
TEveElement * m_geomList
tuple path
else: Piece not in the list, fine.
void DummyEvelyser::remakeGeometry ( const DisplayGeomRecord dgRec)
private

Definition at line 188 of file DummyEvelyser.cc.

References relativeConstraints::geom, edm::eventsetup::EventSetupRecord::get(), m_geomList, make_node(), and edm::ESHandle< class >::product().

189 {
190  m_geomList->DestroyElements();
191 
193  dgRec.get(geom);
194  TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(geom.product()));
195 
196  // To have a full one, all detectors in one top-node:
197  // make_node("/cms:World_1/cms:CMSE_1", 4, kTRUE);
198 
199  make_node("/cms:World_1/cms:CMSE_1/tracker:Tracker_1", 1, kTRUE);
200  make_node("/cms:World_1/cms:CMSE_1/caloBase:CALO_1", 1, kTRUE);
201  make_node("/cms:World_1/cms:CMSE_1/muonBase:MUON_1", 1, kTRUE);
202 }
TEveElement * m_geomList
void get(HolderT &iHolder) const
TEveGeoTopNode * make_node(const TString &path, Int_t vis_level, Bool_t global_cs)
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

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

Definition at line 68 of file DummyEvelyser.cc.

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

TEveElement* DummyEvelyser::m_geomList
private

Definition at line 71 of file DummyEvelyser.cc.

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

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

Definition at line 74 of file DummyEvelyser.cc.

Referenced by analyze().

TEveTrackList* DummyEvelyser::m_trackList
private

Definition at line 72 of file DummyEvelyser.cc.

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

edm::InputTag DummyEvelyser::m_trackTags
private

Definition at line 70 of file DummyEvelyser.cc.

Referenced by analyze().