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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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 49 of file DummyEvelyser.cc.

Constructor & Destructor Documentation

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

Definition at line 94 of file DummyEvelyser.cc.

94  :
95  m_eve(),
97  m_geomList(0),
98  m_trackList(0),
100 {}
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 102 of file DummyEvelyser.cc.

103 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 205 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.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 134 of file DummyEvelyser.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 170 of file DummyEvelyser.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 157 of file DummyEvelyser.cc.

References m_trackList.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 182 of file DummyEvelyser.cc.

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

Definition at line 110 of file DummyEvelyser.cc.

References m_geomList.

Referenced by remakeGeometry().

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

Definition at line 189 of file DummyEvelyser.cc.

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

190 {
191  m_geomList->DestroyElements();
192 
194  dgRec.get(geom);
195  TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(geom.product()));
196 
197  // To have a full one, all detectors in one top-node:
198  // make_node("/cms:World_1/cms:CMSE_1", 4, kTRUE);
199 
200  make_node("/cms:World_1/cms:CMSE_1/tracker:Tracker_1", 1, kTRUE);
201  make_node("/cms:World_1/cms:CMSE_1/caloBase:CALO_1", 1, kTRUE);
202  make_node("/cms:World_1/cms:CMSE_1/muonBase:MUON_1", 1, kTRUE);
203 }
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:62

Member Data Documentation

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

Definition at line 69 of file DummyEvelyser.cc.

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

TEveElement* DummyEvelyser::m_geomList
private

Definition at line 72 of file DummyEvelyser.cc.

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

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

Definition at line 75 of file DummyEvelyser.cc.

Referenced by analyze().

TEveTrackList* DummyEvelyser::m_trackList
private

Definition at line 73 of file DummyEvelyser.cc.

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

edm::InputTag DummyEvelyser::m_trackTags
private

Definition at line 71 of file DummyEvelyser.cc.

Referenced by analyze().