CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
DisplayManager Class Reference

#include <DisplayManager.h>

Public Member Functions

void display (int ientry)
 
void displayAll (bool noRedraw=true)
 
void displayEvent (int run, int lumi, int event)
 
 DisplayManager (PFRootEventManager *em, const char *optfile)
 
void displayNext ()
 
void displayNextInteresting (int ientry)
 
void displayPFBlock (int blockNb)
 
void displayPrevious ()
 
void drawWithNewGraphicAttributes ()
 
void enableDrawBrem (bool state)
 
void enableDrawPFBlock (bool state)
 
void findAndDraw (int ident)
 
void findBlock (int ident)
 
void lookForGenParticle (unsigned barcode)
 look for particle with index i in MC truth. More...
 
void lookForMaxRecHit (bool ecal)
 look for rechit with max energy in ecal or hcal. More...
 
void printDisplay (const char *directory="") const
 
void printGenParticleInfo (std::string name, int barcode, int barcodeMother)
 
void readOptions (const char *file)
 
void reset ()
 
void setNewAttrToSimParticles ()
 
void unZoom ()
 
void updateDisplay ()
 
virtual ~DisplayManager ()
 

Public Attributes

std::multimap< int, std::pair
< int, int > > 
blockIdentsMap_
 
std::vector< float > bremAttributes_
 
TAttLine * bremPatternL_
 
TAttMarker * bremPatternM_
 
double clusEnMin_
 
TAttMarker * clusPattern_
 
TAttMarker * clusPatternecal_
 
TAttMarker * clusPatternhfem_
 
TAttMarker * clusPatternho_
 
TAttMarker * clusPSPattern_
 
std::vector< float > clusterAttributes_
 
bool drawBrems_
 
bool drawClus_
 
bool drawClusterL_
 
bool drawGenParticles_
 
bool drawGsfTracks_
 
bool drawHits_
 
bool drawHO_
 
bool drawParticles_
 
bool drawPFBlocks_
 
bool drawTracks_
 
double genParticlePtMin_
 
TAttMarker * genPartPattern_
 
std::multimap< int, GPFBase * > graphicMap_
 
std::vector< float > gsfAttributes_
 
TAttLine * gsfPatternL_
 
TAttMarker * gsfPatternM_
 
double gsfPtMin_
 
double hitEnMin_
 
double particlePtMin_
 
TAttMarker * simPartPatternDefault_
 
TAttMarker * simPartPatternElec_
 
TAttMarker * simPartPatternK_
 
TAttLine * simPartPatternL_
 
std::vector< TAttMarker * > simPartPatternM_
 
TAttMarker * simPartPatternMuon_
 
TAttMarker * simPartPatternNeutron_
 
TAttMarker * simPartPatternPhoton_
 
TAttMarker * simPartPatternPi_
 
TAttMarker * simPartPatternProton_
 
std::vector< float > trackAttributes_
 
TAttLine * trackPatternL_
 
TAttMarker * trackPatternM_
 
double trackPtMin_
 

Private Member Functions

void createCanvas ()
 
void createGCluster (const reco::PFCluster &cluster, int ident, double phi0=0.)
 
void createGGenParticle (HepMC::GenParticle *p)
 
void createGPart (const reco::PFSimParticle &ptc, const std::vector< reco::PFTrajectoryPoint > &points, int ident, double pt, double phi0, double sign, bool displayInitial, int markerIndex)
 
void createGRecHit (reco::PFRecHit &rh, int ident, double maxe, double phi0=0., int color=4)
 
void createGTrack (reco::PFRecTrack &tr, const std::vector< reco::PFTrajectoryPoint > &points, int ident, double pt, double phi0, double sign, bool displayInitial, int linestyle, int kfgsfbrem=0)
 
void displayCanvas ()
 
void drawGObject (int ident, int color, bool toInitialColor)
 
bool findBadBremsId (int ident)
 
void getDisplayOptions ()
 
double getMaxE (int layer) const
 
double getMaxEEcal ()
 
double getMaxEHcal ()
 
double getMaxEHo ()
 
void loadGClusters ()
 
void loadGGenParticles ()
 
void loadGGsfRecTracks ()
 
void loadGPFBlocks ()
 
void loadGraphicObjects ()
 
void loadGRecHits ()
 
void loadGRecTracks ()
 
void loadGSimParticles ()
 
void retrieveBadBrems ()
 
void rubOutGPFBlock ()
 

Private Attributes

std::vector< int > badBremsId_
 
std::vector< TH2F * > displayHist_
 support histogram for x/y or r/z display. More...
 
std::vector< TCanvas * > displayView_
 vector of canvas for x/y or r/z display More...
 
PFRootEventManagerem_
 
int eventNumber_
 
TBox frontFaceECALRZ_
 ECAL in RZ view. More...
 
TEllipse frontFaceECALXY_
 ECAL in XY view. More...
 
TEllipse frontFaceHCALXY_
 HCAL in XY view. More...
 
TEllipse frontFaceHOXY_
 HO in XY view. More...
 
bool isGraphicLoaded_
 
double maxERecHitEcal_
 
double maxERecHitHcal_
 
double maxERecHitHo_
 
int maxEvents_
 
IOoptions_
 options file parser More...
 
std::vector< int > selectedGObj_
 graphic object containers More...
 
int shiftId_
 
std::vector< int > viewSize_
 display pad xy size for (x,y) or (r,z) display More...
 
std::vector< int > viewSizeEtaPhi_
 display pad xy size for eta/phi view More...
 
double zoomFactor_
 

Detailed Description

Definition at line 34 of file DisplayManager.h.

Constructor & Destructor Documentation

DisplayManager::DisplayManager ( PFRootEventManager em,
const char *  optfile 
)

Definition at line 41 of file DisplayManager.cc.

References createCanvas(), em_, PFRootEventManager::ev_, PFRootEventManager::eventNumber(), eventNumber_, maxEvents_, readOptions(), and fwlite::ChainEvent::size().

42  :
43  em_(em),
44  options_(0),
45  maxERecHitEcal_(-1),
46  maxERecHitHcal_(-1),
47  maxERecHitHo_(-1),
48  isGraphicLoaded_(false),
49  shiftId_(SHIFTID) {
50 
51  readOptions( optfile );
52 
54  //TODOLIST: re_initialize if new option file- better in em
55  maxEvents_= em_->ev_->size();
56  createCanvas();
57 }
const unsigned int SHIFTID
Definition: DisplayCommon.h:27
Long64_t size() const
Definition: ChainEvent.cc:311
fwlite::ChainEvent * ev_
NEW: input event.
PFRootEventManager * em_
double maxERecHitEcal_
IO * options_
options file parser
void readOptions(const char *file)
double maxERecHitHcal_
DisplayManager::~DisplayManager ( )
virtual

Definition at line 59 of file DisplayManager.cc.

References reset().

60 {
61  reset();
62 }

Member Function Documentation

void DisplayManager::createCanvas ( )
private

Definition at line 278 of file DisplayManager.cc.

References gather_cfg::cout, displayHist_, displayView_, drawHO_, PFGeometry::ECALBarrel, PFGeometry::ECALEndcap, EHO, EPE, EPH, frontFaceECALRZ_, frontFaceECALXY_, frontFaceHCALXY_, frontFaceHOXY_, PFGeometry::HCALBarrel, PFGeometry::HOBarrel, PFGeometry::innerRadius(), PFGeometry::innerZ(), NViews, PFGeometry::outerRadius(), RZ, viewSize_, and XY.

Referenced by DisplayManager().

279 {
280 
281  //TODOLIST: better TCanvas *displayView_[4]
282  displayView_.resize(NViews);
283  displayHist_.resize(NViews);
284 
285  // TODOLIST:Canvases size
286  // Add menu to mofify canvas size
287  // Add menu of views to be drawn
288 
289  displayView_[XY] = new TCanvas("displayXY_", "XY view",viewSize_[0], viewSize_[1]);
290  displayView_[RZ] = new TCanvas("displayRZ_", "RZ view",viewSize_[0], viewSize_[1]);
291  displayView_[EPE] = new TCanvas("displayEPE_", "eta/phi view, ECAL",viewSize_[0], viewSize_[1]);
292  displayView_[EPH] = new TCanvas("displayEPH_", "eta/phi view, HCAL",viewSize_[0], viewSize_[1]);
293  if (drawHO_) displayView_[EHO] = new TCanvas("displayEHO_", "eta/phi view, HO",viewSize_[0], viewSize_[1]);
294 
295  for (int viewType=0;viewType<NViews;++viewType) {
296  if (!drawHO_ && viewType==EHO) continue;
297  displayView_[viewType]->SetGrid(0, 0);
298  displayView_[viewType]->SetBottomMargin(0.14);
299  displayView_[viewType]->SetLeftMargin(0.15);
300  displayView_[viewType]->SetRightMargin(0.05);
301  displayView_[viewType]->ToggleToolBar();
302  }
303  // Draw support histogram
304  double zLow = -650.;
305  double zUp = +650.;
306  double rLow = -450.;
307  double rUp = +450.;
308 
309  if (!drawHO_) {zLow = -500.; zUp = +500.; rLow = -300.; rUp = +300.;}
310 
311  displayHist_[XY] = new TH2F("hdisplayHist_XY", "", 500, rLow, rUp,
312  500, rLow, rUp);
313  displayHist_[XY]->SetXTitle("X [cm]");
314  displayHist_[XY]->SetYTitle("Y [cm]");
315 
316  displayHist_[RZ] = new TH2F("hdisplayHist_RZ", "",500, zLow, zUp,
317  500, rLow, rUp);
318  displayHist_[RZ]->SetXTitle("Z [cm]");
319  displayHist_[RZ]->SetYTitle("R [cm]");
320 
321  displayHist_[EPE] = new TH2F("hdisplayHist_EP", "", 500, -5, 5,
322  500, -3.5, 3.5);
323  displayHist_[EPE]->SetXTitle("#eta");
324  displayHist_[EPE]->SetYTitle("#phi [rad]");
325 
327 
328  // displayHist_[EHO] = new TH2F("hdisplayHist_HO", "", 150, -1.5, 1.5,
329  // 500, -3.5, 3.5);
330  // displayHist_[EHO]->SetXTitle("#eta");
331  // displayHist_[EHO]->SetYTitle("#phi [rad]");
332 
334 
335  for (int viewType=0;viewType<NViews;++viewType){
336  if (!drawHO_ && viewType==EHO) continue;
337  displayHist_[viewType]->SetStats(kFALSE);
338  displayHist_[viewType]->GetYaxis()->SetTitleSize(0.06);
339  displayHist_[viewType]->GetYaxis()->SetTitleOffset(1.2);
340  displayHist_[viewType]->GetXaxis()->SetTitleSize(0.06);
341  displayHist_[viewType]->GetYaxis()->SetLabelSize(0.045);
342  displayHist_[viewType]->GetXaxis()->SetLabelSize(0.045);
343  }
344 
345  // Draw ECAL front face
346  frontFaceECALXY_.SetX1(0);
347  frontFaceECALXY_.SetY1(0);
350  frontFaceECALXY_.SetFillStyle(0);
351 
352  // Draw HCAL front face
353  frontFaceHCALXY_.SetX1(0);
354  frontFaceHCALXY_.SetY1(0);
357  frontFaceHCALXY_.SetFillStyle(0);
358 
359  if (drawHO_) {
360  // Draw HO front face
361  frontFaceHOXY_.SetX1(0);
362  frontFaceHOXY_.SetY1(0);
365  frontFaceHOXY_.SetFillStyle(0);
366  }
367 
368  // Draw ECAL side
373  frontFaceECALRZ_.SetFillStyle(0);
374  cout <<"End of DisplayManager::createCanvas()"<<endl;
375 
376 }
std::vector< TCanvas * > displayView_
vector of canvas for x/y or r/z display
TBox frontFaceECALRZ_
ECAL in RZ view.
TEllipse frontFaceHOXY_
HO in XY view.
static const float outerRadius(PFGeometry::Layers_t layer)
return outer radius of a given layer
Definition: PFGeometry.h:60
TEllipse frontFaceECALXY_
ECAL in XY view.
static const float innerRadius(PFGeometry::Layers_t layer)
return inner radius of a given layer
Definition: PFGeometry.h:56
TEllipse frontFaceHCALXY_
HCAL in XY view.
static const float innerZ(PFGeometry::Layers_t layer)
return inner position along z axis of a given layer
Definition: PFGeometry.h:64
tuple cout
Definition: gather_cfg.py:121
std::vector< TH2F * > displayHist_
support histogram for x/y or r/z display.
std::vector< int > viewSize_
display pad xy size for (x,y) or (r,z) display
void DisplayManager::createGCluster ( const reco::PFCluster cluster,
int  ident,
double  phi0 = 0. 
)
private

Definition at line 378 of file DisplayManager.cc.

References clusPattern_, clusPatternecal_, clusPatternhfem_, clusPatternho_, clusPSPattern_, funct::cos(), drawHO_, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, EHO, EPE, EPH, eta(), graphicMap_, PFLayer::HCAL_BARREL2, PFLayer::HF_EM, reco::PFCluster::layer(), NViews, phi, reco::CaloCluster::position(), PFLayer::PS1, PFLayer::PS2, RZ, XY, and reco::CaloCluster::z().

Referenced by loadGClusters().

381 {
382 
383  double eta = cluster.position().Eta();
384  double phi = cluster.position().Phi();
385 
386  // int type = cluster.type();
387  // if(algosToDisplay_.find(type) == algosToDisplay_.end() )
388  // return;
389 
390  // TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
391  // if( cutg && !cutg->IsInside( eta, phi ) ) return;
392 
393 
394  //int color = clusterAttributes_[2];
395  //if ( cluster.layer()==PFLayer::PS1 || cluster.layer()==PFLayer::PS2 )
396  // color = clusterAttributes_[3];
397 
398  //int markerSize = clusterAttributes_[1];
399  //int markerStyle = clusterAttributes_[0];
400 
401  int clusType=0;
402 
403  if ( cluster.layer()==PFLayer::PS1 || cluster.layer()==PFLayer::PS2 )
404  clusType=1;
405 
406  if ( cluster.layer()==PFLayer::ECAL_BARREL || cluster.layer()==PFLayer::ECAL_ENDCAP)
407  clusType=2;
408 
409  if ( cluster.layer()==PFLayer::HF_EM) clusType=3;
410 
411  if ( cluster.layer()==PFLayer::HCAL_BARREL2) clusType=4;
412 
413 
414 
415  const math::XYZPoint& xyzPos = cluster.position();
416 
417  GPFCluster *gc;
418 
419  for (int viewType=0;viewType<NViews;viewType++){
420  if (!drawHO_ && viewType==EHO) continue;
421  switch(viewType) {
422  case XY:
423  {
424  if (clusType==0) {
425  gc = new GPFCluster(this,
426  viewType,ident,
427  &cluster,
428  xyzPos.X(), xyzPos.Y(), clusPattern_);
429  } else if (clusType==1) {
430  gc = new GPFCluster(this,
431  viewType,ident,
432  &cluster,
433  xyzPos.X(), xyzPos.Y(), clusPSPattern_);
434 
435  } else if (clusType==2) {
436  gc = new GPFCluster(this,
437  viewType,ident,
438  &cluster,
439  xyzPos.X(), xyzPos.Y(), clusPatternecal_);
440  } else if (clusType==3) {
441  gc = new GPFCluster(this,
442  viewType,ident,
443  &cluster,
444  xyzPos.X(), xyzPos.Y(), clusPatternhfem_);
445  } else {
446  gc = new GPFCluster(this,
447  viewType,ident,
448  &cluster,
449  xyzPos.X(), xyzPos.Y(), clusPatternho_);
450  }
451  graphicMap_.insert(pair<int,GPFBase *> (ident, gc));
452  }
453  break;
454  case RZ:
455  {
456  double sign = 1.;
457  if (cos(phi0 - phi) < 0.)
458  sign = -1.;
459  if ( clusType==0) {
460  gc = new GPFCluster(this,
461  viewType,ident,
462  &cluster,
463  xyzPos.z(),sign*xyzPos.Rho(),
464  clusPattern_);
465  } else if (clusType==1) {
466  gc = new GPFCluster(this,
467  viewType,ident,
468  &cluster,
469  xyzPos.z(),sign*xyzPos.Rho(),
471  } else if (clusType==2) {
472  gc = new GPFCluster(this,
473  viewType,ident,
474  &cluster,
475  xyzPos.z(),sign*xyzPos.Rho(),
477  } else if (clusType==3) {
478  gc = new GPFCluster(this,
479  viewType,ident,
480  &cluster,
481  xyzPos.z(),sign*xyzPos.Rho(),
483 
484  } else {
485  gc = new GPFCluster(this,
486  viewType,ident,
487  &cluster,
488  xyzPos.z(),sign*xyzPos.Rho(),
490  }
491  graphicMap_.insert(pair<int,GPFBase *> (ident, gc));
492  }
493  break;
494  case EPE:
495  {
496  if( cluster.layer()<0 || cluster.layer()==PFLayer::HF_EM) {
497  if (clusType==2) {
498  gc = new GPFCluster(this,
499  viewType,ident,
500  &cluster,
501  eta,phi,
503  }
504  else if (clusType==3) {
505  gc = new GPFCluster(this,
506  viewType,ident,
507  &cluster,
508  eta,phi,
510  }
511  else {
512  gc = new GPFCluster(this,
513  viewType,ident,
514  &cluster,
515  eta,phi,
517  }
518 
519  graphicMap_.insert(pair<int,GPFBase *> (ident, gc));
520  }
521 
522  }
523  break;
524  case EPH:
525  {
526  if( cluster.layer()>0 && cluster.layer()!=PFLayer::HF_EM && cluster.layer()!=PFLayer::HCAL_BARREL2) {
527  if (clusType==0) {
528  gc = new GPFCluster(this,
529  viewType,ident,
530  &cluster,
531  eta,phi,clusPattern_);
532  }
533  else {
534  gc = new GPFCluster(this,
535  viewType,ident,
536  &cluster,
537  eta,phi,clusPSPattern_);
538  }
539 
540 
541  graphicMap_.insert(pair<int,GPFBase *> (ident, gc));
542  }
543  }
544  break;
545 
546  case EHO:
547  {
548  if( cluster.layer()>0 && cluster.layer()==PFLayer::HCAL_BARREL2) {
549  if (clusType==4) {
550  gc = new GPFCluster(this,
551  viewType,ident,
552  &cluster,
553  eta,phi,clusPatternho_);
554  }
555  else {
556  gc = new GPFCluster(this,
557  viewType,ident,
558  &cluster,
559  eta,phi,clusPSPattern_);
560  }
561 
562 
563  graphicMap_.insert(pair<int,GPFBase *> (ident, gc));
564  }
565  }
566  break;
567 
568  default :break;
569  }
570  }
571 }
PFLayer::Layer layer() const
cluster layer, see PFLayer.h in this directory
Definition: PFCluster.cc:81
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:123
std::multimap< int, GPFBase * > graphicMap_
TAttMarker * clusPatternhfem_
T eta() const
double z() const
z coordinate of cluster centroid
Definition: CaloCluster.h:157
TAttMarker * clusPSPattern_
TAttMarker * clusPatternecal_
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TAttMarker * clusPattern_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
TAttMarker * clusPatternho_
Definition: DDAxes.h:10
void DisplayManager::createGGenParticle ( HepMC::GenParticle *  p)
private

Definition at line 1517 of file DisplayManager.cc.

References drawHO_, alignCSCRings::e, em_, eta(), configurableAnalysis::GenParticle, GENPARTICLEID, genPartPattern_, PFRootEventManager::getGenParticleName(), graphicMap_, mergeVDriftHistosByStation::name, NViews, phi, shiftId_, x, and detailsBasic3DVector::y.

Referenced by loadGGenParticles().

1518 {
1519  // these are the beam protons
1520  if ( !p->production_vertex() && p->pdg_id() == 2212 ) return;
1521 
1522  int partId = p->pdg_id();
1523 
1524  std::string name;
1525  std::string latexStringName;
1526 
1527  name = em_->getGenParticleName(partId,latexStringName);
1528  int barcode = p->barcode();
1529  int genPartId=(GENPARTICLEID<<shiftId_) | barcode;
1530 
1531 
1532 // int vertexId1 = 0;
1533 // vertexId1 = p->production_vertex()->barcode();
1534 
1535 // math::XYZVector vertex1 (p->production_vertex()->position().x(),
1536 // p->production_vertex()->position().y(),
1537 // p->production_vertex()->position().z());
1538 
1539  math::XYZTLorentzVector momentum1(p->momentum().px(),
1540  p->momentum().py(),
1541  p->momentum().pz(),
1542  p->momentum().e());
1543 
1544  double eta = momentum1.eta();
1545  if ( eta > +10. ) eta = +10.;
1546  if ( eta < -10. ) eta = -10.;
1547 
1548  double phi = momentum1.phi();
1549 
1550  double pt = momentum1.pt();
1551  double e = momentum1.e();
1552 
1553  //mother ?
1554 
1555  // Colin: the following line gives a segmentation fault when there is
1556  // no particles entering the production vertex.
1557 
1558  // const HepMC::GenParticle* mother =
1559  // *(p->production_vertex()->particles_in_const_begin());
1560 
1561  // protecting against this in the following way:
1562  const HepMC::GenParticle* mother = 0;
1563  if(p->production_vertex() &&
1564  p->production_vertex()->particles_in_size() ) {
1565  mother =
1566  *(p->production_vertex()->particles_in_const_begin());
1567  }
1568 
1569  // Colin: no need to declare this pointer in this context.
1570  // the declaration can be more local.
1571  // GPFGenParticle *gp;
1572 
1573  int modnViews = (drawHO_) ? NViews : NViews-1;
1574  if ( mother ) {
1575  int barcodeMother = mother->barcode();
1576  math::XYZTLorentzVector momentumMother(mother->momentum().px(),
1577  mother->momentum().py(),
1578  mother->momentum().pz(),
1579  mother->momentum().e());
1580  double etaMother = momentumMother.eta();
1581  if ( etaMother > +10. ) etaMother = +10.;
1582  if ( etaMother < -10. ) etaMother = -10.;
1583  double phiMother = momentumMother.phi();
1584 
1585 
1586  double x[2],y[2];
1587 
1588 
1589  x[0]=etaMother;x[1]=eta;
1590  y[0]=phiMother;y[1]=phi;
1591 
1592  for (int view = 2; view< modnViews; view++) {
1593  GPFGenParticle* gp = new GPFGenParticle(this,
1594  view, genPartId,
1595  x, y, //double *, double *
1596  e,pt,barcode,barcodeMother,
1597  genPartPattern_,
1598  name,latexStringName);
1599  graphicMap_.insert(pair<int,GPFBase *> (genPartId, gp));
1600  }
1601  }
1602  else { //no Mother
1603  for (int view = 2; view< modnViews; view++) {
1604  GPFGenParticle* gp = new GPFGenParticle(this,
1605  view, genPartId,
1606  eta, phi, //double double
1607  e,pt,barcode,
1609  name, latexStringName);
1610  graphicMap_.insert(pair<int,GPFBase *> (genPartId, gp));
1611  }
1612  }
1613 }
std::string getGenParticleName(int partId, std::string &latexStringName) const
get name of genParticle
std::multimap< int, GPFBase * > graphicMap_
TAttMarker * genPartPattern_
T eta() const
PFRootEventManager * em_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
Definition: DDAxes.h:10
Definition: DDAxes.h:10
void DisplayManager::createGPart ( const reco::PFSimParticle ptc,
const std::vector< reco::PFTrajectoryPoint > &  points,
int  ident,
double  pt,
double  phi0,
double  sign,
bool  displayInitial,
int  markerIndex 
)
private

no point inside graphical cut.

Definition at line 573 of file DisplayManager.cc.

References reco::PFTrajectoryPoint::ClosestApproach, gather_cfg::cout, drawHO_, EHO, EPE, EPH, eta(), graphicMap_, i, NViews, phi, RZ, simPartPatternL_, simPartPatternM_, xPos, XY, and yPos.

Referenced by loadGSimParticles().

577 {
578  //bool inside = false;
579  //TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
580  bool debug_createGpart = false;
581  // bool debug_createGpart = true;
582  for (int viewType=0;viewType<NViews;++viewType) {
583  if (!drawHO_ && viewType==EHO) continue;
584  // for (int viewType=0;viewType<4;++viewType) {
585  // reserving space. nb not all trajectory points are valid
586  vector<double> xPos;
587  xPos.reserve( points.size() );
588  vector<double> yPos;
589  yPos.reserve( points.size() );
590 
591  for(unsigned i=0; i<points.size(); i++) {
592 
593  if( !points[i].isValid() ) continue;
594 
595  const math::XYZPoint& xyzPos = points[i].position();
596 
597  double eta = xyzPos.Eta();
598  double phi = xyzPos.Phi();
599 
600  // always take momentum for the first point
601  // otherwise decay products from resonances will have wrong eta, phi
602  //calculated from position (0,0,0) (MDN 11 June 2008)
603  if( points[i].layer() == reco::PFTrajectoryPoint::ClosestApproach ) {
604 
605  // if( !displayInitial &&
606  // points[i].layer() == reco::PFTrajectoryPoint::ClosestApproach ) {
607  const math::XYZTLorentzVector& mom = points[i].momentum();
608  eta = mom.Eta();
609  phi = mom.Phi();
610  }
611 
612  //if( !cutg || cutg->IsInside( eta, phi ) )
613  // inside = true;
614 
615  switch(viewType) {
616  case XY:
617  xPos.push_back(xyzPos.X());
618  yPos.push_back(xyzPos.Y());
619  break;
620  case RZ:
621  xPos.push_back(xyzPos.Z());
622  yPos.push_back(sign*xyzPos.Rho());
623  break;
624  case EPE:
625  case EPH:
626  case EHO:
627  xPos.push_back( eta );
628  yPos.push_back( phi );
629  break;
630  default:break;
631  }
632  }
633  if (viewType == EPE && debug_createGpart) {
634  cout << " display PFsim eta/phi view ECAL" << endl;
635  cout << " nb of points for display " << xPos.size() << endl;
636  for(unsigned i=0; i<xPos.size(); i++) {
637  cout << " point " << i << " x/y " << xPos[i] <<"/" << yPos[i]<< endl;
638  }
639  }
640 
642  //if( !inside ) return;
643  //int color = 4;
644  GPFSimParticle *gc = new GPFSimParticle(this,
645  viewType, ident,
646  &ptc,
647  xPos.size(),&xPos[0],&yPos[0],
648  pt,
649  simPartPatternM_[markerIndex],
651  "pl");
652 
653  graphicMap_.insert(pair<int,GPFBase *> (ident, gc));
654  //graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFSimParticle(this,viewType,ident,&ptc,xPos.size(),&xPos[0],&yPos[0],pt,simPartPattern_[indexMarker], "pl")));
655  }
656 }
int i
Definition: DBlmapReader.cc:9
std::multimap< int, GPFBase * > graphicMap_
std::vector< TAttMarker * > simPartPatternM_
T eta() const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
double xPos
Point of closest approach from beam axis (initial point in the case of PFSimParticle) ...
double yPos
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
TAttLine * simPartPatternL_
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
void DisplayManager::createGRecHit ( reco::PFRecHit rh,
int  ident,
double  maxe,
double  phi0 = 0.,
int  color = 4 
)
private

Definition at line 658 of file DisplayManager.cc.

References dtNoiseDBValidation_cfg::cerr, PFRootEventManager::clusterAlgoECAL_, PFRootEventManager::clusterAlgoHCAL_, PFRootEventManager::clusterAlgoHFEM_, PFRootEventManager::clusterAlgoHFHAD_, PFRootEventManager::clusterAlgoPS_, funct::cos(), drawHO_, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, EHO, em_, reco::PFRecHit::energy(), EPE, EPH, eta(), reco::PFRecHit::getCornersXYZ(), graphicMap_, PFLayer::HCAL_BARREL1, PFLayer::HCAL_BARREL2, PFLayer::HCAL_ENDCAP, PFLayer::HF_EM, PFLayer::HF_HAD, reco::PFRecHit::layer(), create_public_lumi_plots::log, NViews, phi, Pi, reco::PFRecHit::position(), PFLayer::PS1, PFLayer::PS2, alignCSCRings::r, RZ, GOODCOLL_filter_cfg::thresh, PFClusterAlgo::threshBarrel(), PFClusterAlgo::threshEndcap(), x, XY, detailsBasic3DVector::y, and detailsBasic3DVector::z.

Referenced by loadGRecHits().

659 {
660 
661  double me = maxe;
662  double thresh = 0;
663  int layer = rh.layer();
664 
665 
666  switch(layer) {
668  thresh = em_->clusterAlgoECAL_.threshBarrel();
669  break;
671  thresh = em_->clusterAlgoECAL_.threshEndcap();
672  break;
675  thresh = em_->clusterAlgoHCAL_.threshBarrel();
676  break;
678  thresh = em_->clusterAlgoHCAL_.threshEndcap();
679  break;
680  case PFLayer::HF_HAD:
681  // how to handle a different threshold for HF?
682  thresh = em_->clusterAlgoHFHAD_.threshEndcap();
683  break;
684  case PFLayer::HF_EM:
685  // how to handle a different threshold for HF?
686  thresh = em_->clusterAlgoHFEM_.threshEndcap();
687  break;
688  case PFLayer::PS1:
689  case PFLayer::PS2:
690  me = -1;
691  thresh = em_->clusterAlgoPS_.threshBarrel();
692  break;
693  default:
694  {
695  cerr<<"DisplayManager::createGRecHit : manage other layers."
696  <<" GRechit notcreated."<<endl;
697  return;
698  }
699  }
700  if( rh.energy() < thresh ) return;
701 
702  //loop on all views
703  for(int viewType=0;viewType<NViews;++viewType) {
704  if (!drawHO_ && viewType==EHO) continue;
705 
706  bool isHCAL = (layer == PFLayer::HCAL_BARREL1 ||
707  // layer == PFLayer::HCAL_BARREL2 ||
708  layer == PFLayer::HCAL_ENDCAP ||
709  layer == PFLayer::HF_HAD);
710 
711  if( viewType == EPH &&
712  ! isHCAL) {
713  continue;
714  }
715  // on EPE view, draw only HCAL and preshower
716  if( viewType == EPE && (isHCAL || layer ==PFLayer::HCAL_BARREL2)) {
717  continue;
718  }
719 
720  if (viewType == EHO && layer !=PFLayer::HCAL_BARREL2) continue;
721 
722 
723  double rheta = rh.position().Eta();
724  double rhphi = rh.position().Phi();
725 
726  double sign = 1.;
727  if (cos(phi0 - rhphi) < 0.) sign = -1.;
728 
729 
730  double etaSize[4];
731  double phiSize[4];
732  double x[5];
733  double y[5];
734  double z[5];
735  double r[5];
736  double eta[5];
737  double phi[5];
738  double xprop[5];
739  double yprop[5];
740  double etaprop[5];
741  double phiprop[5];
742 
743 
744  const std::vector< math::XYZPoint >& corners = rh.getCornersXYZ();
745  assert(corners.size() == 4);
746  double propfact = 0.95; // so that the cells don't overlap ?
747  double ampl=0;
748  if(me>0) ampl = (log(rh.energy() + 1.)/log(me + 1.));
749  for ( unsigned jc=0; jc<4; ++jc ) {
750 
751  phiSize[jc] = rhphi-corners[jc].Phi();
752  etaSize[jc] = rheta-corners[jc].Eta();
753  if ( phiSize[jc] > 1. ) phiSize[jc] -= 2.*TMath::Pi();
754  if ( phiSize[jc] < -1. ) phiSize[jc]+= 2.*TMath::Pi();
755 
756  phiSize[jc] *= propfact;
757  etaSize[jc] *= propfact;
758 
759  math::XYZPoint cornerposxyz = corners[jc];
760 
761  x[jc] = cornerposxyz.X();
762  y[jc] = cornerposxyz.Y();
763  z[jc] = cornerposxyz.Z();
764  r[jc] = sign*cornerposxyz.Rho();
765  eta[jc] = rheta - etaSize[jc];
766  phi[jc] = rhphi - phiSize[jc];
767 
768 
769  // cell area is prop to log(E)
770  // not drawn for preshower.
771  // otherwise, drawn for eta/phi view, and for endcaps in xy view
772  if( layer != PFLayer::PS1 &&
773  layer != PFLayer::PS2 &&
774  ( viewType == EPE ||
775  viewType == EPH ||
776  viewType == EHO ||
777  ( viewType == XY &&
778  ( layer == PFLayer::ECAL_ENDCAP ||
779  layer == PFLayer::HCAL_ENDCAP ||
780  layer == PFLayer::HF_HAD
781  ) ) ) ) {
782 
783  math::XYZPoint centreXYZrot = rh.position();
784 
785  math::XYZPoint centertocorner(x[jc] - centreXYZrot.X(),
786  y[jc] - centreXYZrot.Y(),
787  0 );
788 
789  math::XYZPoint centertocornerep(eta[jc] - centreXYZrot.Eta(),
790  phi[jc] - centreXYZrot.Phi(),
791  0 );
792 
793 
794  // centertocorner -= centreXYZrot;
795  xprop[jc] = centreXYZrot.X() + centertocorner.X()*ampl;
796  yprop[jc] = centreXYZrot.Y() + centertocorner.Y()*ampl;
797 
798  etaprop[jc] = centreXYZrot.Eta() + centertocornerep.X()*ampl;
799  phiprop[jc] = centreXYZrot.Phi() + centertocornerep.Y()*ampl;
800  }
801  }//loop on jc
802 
803  if(layer == PFLayer::ECAL_BARREL ||
804  layer == PFLayer::HCAL_BARREL1 ||
805  layer == PFLayer::HCAL_BARREL2 || viewType == RZ) {
806 
807  // we are in the barrel. Determining which corners to shift
808  // away from the center to represent the cell energy
809 
810  int i1 = -1;
811  int i2 = -1;
812 
813  if(fabs(phiSize[1]-phiSize[0]) > 0.0001) {
814  if (viewType == XY) {
815  i1 = 2;
816  i2 = 3;
817  } else if (viewType == RZ) {
818  i1 = 1;
819  i2 = 2;
820  }
821  } else {
822  if (viewType == XY) {
823  i1 = 1;
824  i2 = 2;
825  } else if (viewType == RZ) {
826  i1 = 2;
827  i2 = 3;
828  }
829  }
830 
831  double signx=1.;
832  if(layer == PFLayer::HCAL_BARREL2) { signx=-1.;}
833 
834  x[i1] *= 1+signx*ampl/2.;
835  x[i2] *= 1+signx*ampl/2.;
836  y[i1] *= 1+signx*ampl/2.;
837  y[i2] *= 1+signx*ampl/2.;
838  z[i1] *= 1+signx*ampl/2.;
839  z[i2] *= 1+signx*ampl/2.;
840  r[i1] *= 1+signx*ampl/2.;
841  r[i2] *= 1+signx*ampl/2.;
842 
843  }
844 
845  x[4]=x[0];
846  y[4]=y[0]; // closing the polycell
847  z[4]=z[0];
848  r[4]=r[0]; // closing the polycell
849  eta[4]=eta[0];
850  phi[4]=phi[0]; // closing the polycell
851 
852  int npoints=5;
853 
854  switch( viewType ) {
855  case XY:
856  {
857  if(layer == PFLayer::ECAL_BARREL ||
858  layer == PFLayer::HCAL_BARREL1 ||
859  layer == PFLayer::HCAL_BARREL2) {
860  graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFRecHit(this, viewType,ident,&rh,npoints,x,y,color,"f")));
861 
862  } else {
863  graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFRecHit(this, viewType,ident,&rh,npoints,x,y,color,"l")));
864  if( ampl>0 ) { // not for preshower
865  xprop[4]=xprop[0];
866  yprop[4]=yprop[0]; // closing the polycell
867  graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFRecHit(this, viewType,ident,&rh,npoints,xprop,yprop,color,"f")));
868  }
869  }
870  }
871  break;
872 
873  case RZ:
874  graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFRecHit(this, viewType,ident,&rh,npoints,z,r,color,"f")));
875  break;
876 
877  case EPE:
878  {
879  graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFRecHit(this, viewType,ident,&rh,npoints,eta,phi,color,"l")));
880 
881  if( ampl>0 ) { // not for preshower
882  etaprop[4]=etaprop[0];
883  phiprop[4]=phiprop[0]; // closing the polycell
884  graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFRecHit(this, viewType,ident,&rh,npoints,etaprop,phiprop,color,"f")));
885  }
886  }
887  break;
888  case EPH:
889  {
890  if(layer == PFLayer::ECAL_BARREL ||
891  layer == PFLayer::HCAL_BARREL1) {
892  graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFRecHit(this, viewType,ident,&rh,npoints,eta,phi,color,"l")));
893 
894  if( ampl>0 ) { // not for preshower
895  etaprop[4]=etaprop[0];
896  phiprop[4]=phiprop[0]; // closing the polycell
897  graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFRecHit(this, viewType,ident,&rh,npoints,etaprop,phiprop,color,"f")));
898  }
899  }
900  }
901  break;
902 
903  case EHO:
904  {
905 
906  graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFRecHit(this, viewType,ident,&rh,npoints,eta,phi,color,"l")));
907  if(layer == PFLayer::HCAL_BARREL2) {
908  if( ampl>0 ) { // not for preshower
909  etaprop[4]=etaprop[0];
910  phiprop[4]=phiprop[0]; // closing the polycell
911  graphicMap_.insert(pair<int,GPFBase *> (ident,new GPFRecHit(this, viewType,ident,&rh,npoints,etaprop,phiprop,color,"f")));
912  }
913  }
914  }
915  break;
916 
917 
918 
919  default: break;
920  }//switch end
921 
922  } //loop on views
923 }
const double Pi
PFClusterAlgo clusterAlgoHFEM_
clustering algorithm for HF, electro-magnetic layer
std::multimap< int, GPFBase * > graphicMap_
double threshBarrel() const
getters -------------------------------------------------——
PFClusterAlgo clusterAlgoECAL_
T eta() const
double double double z
PFRootEventManager * em_
PFLayer::Layer layer() const
rechit layer
Definition: PFRecHit.h:102
const std::vector< math::XYZPoint > & getCornersXYZ() const
rechit corners
Definition: PFRecHit.h:144
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
PFClusterAlgo clusterAlgoHCAL_
clustering algorithm for HCAL
double threshEndcap() const
get endcap threshold
const math::XYZPoint & position() const
is seed ?
Definition: PFRecHit.h:135
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
PFClusterAlgo clusterAlgoPS_
clustering algorithm for PS
double energy() const
rechit energy
Definition: PFRecHit.h:105
PFClusterAlgo clusterAlgoHFHAD_
clustering algorithm for HF, hadronic layer
Definition: DDAxes.h:10
Definition: DDAxes.h:10
void DisplayManager::createGTrack ( reco::PFRecTrack tr,
const std::vector< reco::PFTrajectoryPoint > &  points,
int  ident,
double  pt,
double  phi0,
double  sign,
bool  displayInitial,
int  linestyle,
int  kfgsfbrem = 0 
)
private

no point inside graphical cut.

Definition at line 926 of file DisplayManager.cc.

References bremPatternL_, bremPatternM_, reco::PFTrajectoryPoint::ClosestApproach, drawHO_, EHO, EPE, EPH, eta(), graphicMap_, gsfPatternL_, gsfPatternM_, gt, i, NViews, phi, RZ, trackPatternL_, trackPatternM_, xPos, XY, and yPos.

Referenced by loadGGsfRecTracks(), and loadGRecTracks().

930 {
931 
932  // bool inside = false;
933  //TCutG* cutg = (TCutG*) gROOT->FindObject("CUTG");
934 
935  for (int viewType=0;viewType<NViews;++viewType) {
936  if (!drawHO_ && viewType==EHO) continue;
937  // reserving space. nb not all trajectory points are valid
938  vector<double> xPos;
939  xPos.reserve( points.size() );
940  vector<double> yPos;
941  yPos.reserve( points.size() );
942 
943  for(unsigned i=0; i<points.size(); i++) {
944  if( !points[i].isValid() ) continue;
945 
946  const math::XYZPoint& xyzPos = points[i].position();
947  //muriel
948  //if(kfgsfbrem)
949  // std::cout << xyzPos << std::endl;
950  double eta = xyzPos.Eta();
951  double phi = xyzPos.Phi();
952 
953  if( !displayInitial &&
954  points[i].layer() == reco::PFTrajectoryPoint::ClosestApproach ) {
955  const math::XYZTLorentzVector& mom = points[i].momentum();
956  eta = mom.Eta();
957  phi = mom.Phi();
958  }
959 
960  //if( !cutg || cutg->IsInside( eta, phi ) )
961  // inside = true;
962 
963 
964  switch(viewType) {
965  case XY:
966  xPos.push_back(xyzPos.X());
967  yPos.push_back(xyzPos.Y());
968  break;
969  case RZ:
970  xPos.push_back(xyzPos.Z());
971  yPos.push_back(sign*xyzPos.Rho());
972  break;
973  case EPE:
974  case EPH:
975  case EHO:
976  xPos.push_back( eta );
977  yPos.push_back( phi );
978  break;
979  }
980  }
982  //if( !inside ) return;
983 
984  //fill map with graphic objects
985  GPFTrack *gt=0;
986  if(kfgsfbrem==0) {
987  gt = new GPFTrack(this,
988  viewType,ident,
989  &tr,
990  xPos.size(),&xPos[0],&yPos[0],pt,
992  }
993  else if (kfgsfbrem==1) {
994  // std::cout << " Creating the GSF track " << std::endl;
995  gt = new GPFTrack(this,
996  viewType,ident,
997  &tr,
998  xPos.size(),&xPos[0],&yPos[0],pt,
1000  }
1001  else if (kfgsfbrem==2) {
1002  // std::cout << " Creating the Brem " << std::endl;
1003  // std::cout<<"adr brem dans create:"<<&tr<<std::flush<<std::endl;
1004  gt = new GPFTrack(this,
1005  viewType,ident,
1006  &tr,
1007  xPos.size(),&xPos[0],&yPos[0],pt,
1009  }
1010  graphicMap_.insert(pair<int,GPFBase *> (ident, gt));
1011  }
1012 }
int i
Definition: DBlmapReader.cc:9
std::multimap< int, GPFBase * > graphicMap_
TAttMarker * gsfPatternM_
TAttLine * trackPatternL_
T eta() const
TAttMarker * trackPatternM_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
double xPos
TAttMarker * bremPatternM_
Point of closest approach from beam axis (initial point in the case of PFSimParticle) ...
double yPos
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
TAttLine * gsfPatternL_
TAttLine * bremPatternL_
DTRecHit1DPair & gt
Definition: DDAxes.h:10
void DisplayManager::display ( int  ientry)

Definition at line 1026 of file DisplayManager.cc.

References dtNoiseDBValidation_cfg::cerr, displayAll(), em_, PFRootEventManager::eventNumber(), eventNumber_, isGraphicLoaded_, loadGraphicObjects(), maxEvents_, PFRootEventManager::processEntry(), and reset().

Referenced by displayNext(), displayPrevious(), and DialogFrame::doReProcessEvent().

1027 {
1028  if (ientry<0 || ientry>maxEvents_) {
1029  std::cerr<<"DisplayManager::no event matching criteria"<<std::endl;
1030  return;
1031  }
1032  reset();
1033  em_->processEntry(ientry);
1036  isGraphicLoaded_= true;
1037 
1038  displayAll();
1039 
1040 }
void displayAll(bool noRedraw=true)
PFRootEventManager * em_
virtual bool processEntry(int entry)
process one entry (pass the TTree entry)
void DisplayManager::displayAll ( bool  noRedraw = true)

Definition at line 1042 of file DisplayManager.cc.

References BREMID, clusEnMin_, CLUSTERECALID, CLUSTERHCALID, CLUSTERHFEMID, CLUSTERHFHADID, CLUSTERHOID, CLUSTERIBID, CLUSTERPSID, gather_cfg::cout, displayCanvas(), displayView_, drawBrems_, drawClus_, drawGenParticles_, drawGsfTracks_, drawHits_, drawHO_, drawParticles_, drawTracks_, EHO, EPE, EPH, GENPARTICLEID, genParticlePtMin_, graphicMap_, gsfPtMin_, GSFRECTRACKID, hitEnMin_, i, isGraphicLoaded_, NViews, AlCaHLTBitMon_ParallelJobs::p, particlePtMin_, RECHITECALID, RECHITHCALID, RECHITHFEMID, RECHITHFHADID, RECHITHOID, RECHITPSID, RECTRACKID, shiftId_, SIMPARTICLEID, and trackPtMin_.

Referenced by DialogFrame::areBremVisible(), display(), displayEvent(), displayNextInteresting(), DialogFrame::doModifyOptions(), DialogFrame::doModifyPtThreshold(), drawWithNewGraphicAttributes(), and findAndDraw().

1043 {
1044 
1045  if (!isGraphicLoaded_) {
1046  std::cout<<" no Graphic Objects to draw"<<std::endl;
1047  return;
1048  }
1049  if (noRedraw) {
1050  for (int viewType=0;viewType<NViews;++viewType) {
1051  if (!drawHO_ && viewType==EHO) continue;
1052  displayView_[viewType]->cd();
1053  gPad->Clear();
1054  }
1055  //TODOLIST: add test on view to draw
1056  displayCanvas();
1057  }
1058 
1059  std::multimap<int,GPFBase *>::iterator p;
1060 
1061  for (p=graphicMap_.begin();p!=graphicMap_.end();p++) {
1062  int ident=p->first;
1063  int type=ident >> shiftId_;
1064  int view = p->second->getView();
1065 
1066  if (!drawHO_ && (view ==EHO || type==CLUSTERHOID || type==RECHITHOID)) continue;
1067 
1068  switch (type) {
1069  case CLUSTERECALID:
1070  case CLUSTERHCALID:
1071  case CLUSTERHOID:
1072  case CLUSTERHFEMID:
1073  case CLUSTERHFHADID:
1074  case CLUSTERPSID:
1075  case CLUSTERIBID:
1076  {
1077  // cout<<"displaying "<<type<<" "<<p->second->getEnergy()<<" "<<clusEnMin_<<" on view "<<view<<endl;
1078  if (drawClus_)
1079  if (p->second->getEnergy() > clusEnMin_) {
1080  displayView_[view]->cd();
1081  p->second->draw();
1082  }
1083  }
1084  break;
1085  case RECHITECALID:
1086  case RECHITHCALID:
1087  case RECHITHOID:
1088  case RECHITHFEMID:
1089  case RECHITHFHADID:
1090  case RECHITPSID:
1091  {
1092  if (!noRedraw) break;
1093  if (drawHits_)
1094  if(p->second->getEnergy() > hitEnMin_) {
1095  displayView_[view]->cd();
1096  p->second->draw();
1097  }
1098  break;
1099  }
1100  case RECTRACKID:
1101  {
1102  if (drawTracks_)
1103  if (p->second->getPt() > trackPtMin_) {
1104  displayView_[view]->cd();
1105  p->second->draw();
1106  }
1107  }
1108  break;
1109  case GSFRECTRACKID:
1110  {
1111  if (drawGsfTracks_)
1112  if (p->second->getPt() > gsfPtMin_) {
1113  displayView_[view]->cd();
1114  p->second->draw();
1115  }
1116  }
1117  break;
1118  case BREMID:
1119  {
1120  if (drawBrems_)
1121  {
1122  displayView_[view]->cd();
1123  p->second->draw();
1124  }
1125  }
1126  break;
1127  case SIMPARTICLEID:
1128  {
1129  if (drawParticles_)
1130  if (p->second->getPt() > particlePtMin_) {
1131  displayView_[view]->cd();
1132  p->second->draw();
1133  }
1134  }
1135  break;
1136  case GENPARTICLEID:
1137  {
1138  if (drawGenParticles_)
1139  if (p->second->getPt() > genParticlePtMin_)
1140  if (view == EPH || view ==EPE || view ==EHO) {
1141  displayView_[view]->cd();
1142  p->second->draw();
1143  }
1144  }
1145  break;
1146  default : std::cout<<"DisplayManager::displayAll()-- unknown object "<<std::endl;
1147  } //switch end
1148  } //for end
1149 
1150  for (int i=0;i<NViews;i++) {
1151  if (!drawHO_ && i==EHO) continue;
1152  displayView_[i]->cd();
1153  gPad->Modified();
1154  displayView_[i]->Update();
1155  }
1156 }
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
std::multimap< int, GPFBase * > graphicMap_
std::vector< TCanvas * > displayView_
vector of canvas for x/y or r/z display
double particlePtMin_
tuple cout
Definition: gather_cfg.py:121
double genParticlePtMin_
void DisplayManager::displayCanvas ( )
private

Definition at line 1191 of file DisplayManager.cc.

References displayHist_, displayView_, drawHO_, EHO, eta(), jptDQMConfig_cff::etaMax, jptDQMConfig_cff::etaMin, frontFaceECALRZ_, frontFaceECALXY_, frontFaceHCALXY_, frontFaceHOXY_, prof2calltree::l, NViews, alignCSCRings::r, RZ, funct::tan(), and XY.

Referenced by displayAll().

1192 {
1193  double zLow = -500.;
1194  double zUp = +500.;
1195  double rUp = +400.;
1196  if (!drawHO_) rUp=300.0;
1197  double etarng=(drawHO_) ? 1.19 : 1.39;
1198  double ratio =(drawHO_) ? 1.15 : 0.90;
1199  double scal = (drawHO_) ? 1.00 : 0.85;
1200 
1201  //TODOLIST : test wether view on/off
1202  //if (!displayView_[viewType] || !gROOT->GetListOfCanvases()->FindObject(displayView_[viewType]) ) {
1203  // assert(viewSize_.size() == 2);
1204 
1205 
1206 
1207  for (int viewType=0;viewType<NViews;++viewType) {
1208  if (!drawHO_ && viewType==EHO) continue;
1209  displayView_[viewType]->cd();
1210  displayHist_[viewType]->Draw();
1211  switch(viewType) {
1212  case XY:
1213  frontFaceECALXY_.Draw();
1214  frontFaceHCALXY_.Draw();
1215  frontFaceHOXY_.Draw();
1216  break;
1217  case RZ:
1218  {// Draw lines at different etas
1219  TLine l;
1220  l.SetLineColor(1);
1221  l.SetLineStyle(3);
1222  TLatex etaLeg;
1223  etaLeg.SetTextSize( (drawHO_) ? 0.03 : 0.02);
1224  float etaMin = -3.;
1225  float etaMax = +3.;
1226  float etaBin = 0.2;
1227  int nEtas = int((etaMax - etaMin)/0.2) + 1;
1228  for (int iEta = 0; iEta <= nEtas; iEta++) {
1229  float eta = etaMin + iEta*etaBin;
1230  float r = ratio*rUp;
1231  TVector3 etaImpact;
1232  etaImpact.SetPtEtaPhi(r, eta, 0.);
1233  etaLeg.SetTextAlign(21);
1234  if (eta <= -etarng) {
1235  etaImpact.SetXYZ(0.,scal*zLow*tan(etaImpact.Theta()),scal*zLow);
1236  etaLeg.SetTextAlign(31);
1237  } else if (eta >= etarng) {
1238  etaImpact.SetXYZ(0.,scal*zUp*tan(etaImpact.Theta()),scal*zUp);
1239  etaLeg.SetTextAlign(11);
1240  }
1241  if (drawHO_) {
1242  if (fabs(eta)<1.29) {
1243  etaLeg.SetTextSize(0.030);
1244  } else {
1245  etaLeg.SetTextSize(0.022);
1246  }
1247  }
1248  l.DrawLine(0., 0., etaImpact.Z(), etaImpact.Perp());
1249  etaLeg.DrawLatex(1.0*etaImpact.Z(), etaImpact.Perp(), Form("%2.1f", eta));
1250  }
1251  frontFaceECALRZ_.Draw();
1252  }
1253  break;
1254  default: break;
1255  } //end switch
1256  }
1257 }
std::vector< TCanvas * > displayView_
vector of canvas for x/y or r/z display
T eta() const
TBox frontFaceECALRZ_
ECAL in RZ view.
TEllipse frontFaceHOXY_
HO in XY view.
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
TEllipse frontFaceECALXY_
ECAL in XY view.
TEllipse frontFaceHCALXY_
HCAL in XY view.
std::vector< TH2F * > displayHist_
support histogram for x/y or r/z display.
void DisplayManager::displayEvent ( int  run,
int  lumi,
int  event 
)

Definition at line 1015 of file DisplayManager.cc.

References displayAll(), em_, PFRootEventManager::eventNumber(), eventNumber_, isGraphicLoaded_, loadGraphicObjects(), PFRootEventManager::processEvent(), and reset().

1015  {
1016  reset();
1017  em_->processEvent(run, lumi, event);
1020  isGraphicLoaded_= true;
1021  displayAll();
1022 }
void displayAll(bool noRedraw=true)
tuple lumi
Definition: fjr2json.py:35
PFRootEventManager * em_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual bool processEvent(int run, int lumi, int event)
process one event (pass the CMS event number)
void DisplayManager::displayNext ( )

Definition at line 1259 of file DisplayManager.cc.

References display(), em_, PFRootEventManager::eventNumber(), and eventNumber_.

Referenced by DialogFrame::doNextEvent().

1260 {
1261  int eventNumber_=em_->eventNumber();
1262  display(++eventNumber_);
1263 }
void display(int ientry)
PFRootEventManager * em_
void DisplayManager::displayNextInteresting ( int  ientry)

Definition at line 1265 of file DisplayManager.cc.

References dtNoiseDBValidation_cfg::cerr, displayAll(), em_, PFRootEventManager::eventNumber(), eventNumber_, isGraphicLoaded_, loadGraphicObjects(), convertSQLiteXML::ok, PFRootEventManager::processEntry(), and reset().

1266 {
1267  bool ok=false;
1268  while (!ok && ientry<em_->ev_->size() ) {
1269  ok = em_->processEntry(ientry);
1270  ientry++;
1271  }
1273  if (ok) {
1274  reset();
1276  isGraphicLoaded_= true;
1277  displayAll();
1278  }
1279  else
1280  std::cerr<<"DisplayManager::dislayNextInteresting : no event matching criteria"<<std::endl;
1281 }
void displayAll(bool noRedraw=true)
PFRootEventManager * em_
virtual bool processEntry(int entry)
process one entry (pass the TTree entry)
void DisplayManager::displayPFBlock ( int  blockNb)

Definition at line 1298 of file DisplayManager.cc.

References blockIdentsMap_, create_public_lumi_plots::color, gather_cfg::cout, drawGObject(), drawPFBlocks_, first, AlCaHLTBitMon_ParallelJobs::p, rubOutGPFBlock(), and selectedGObj_.

Referenced by findBlock().

1299 {
1300  rubOutGPFBlock();
1301  selectedGObj_.clear();
1302  if (!drawPFBlocks_) return;
1303  int color=1;
1304  multimap<int,pair <int,int > >::const_iterator p;
1305  p= blockIdentsMap_.find(blockNb);
1306  if (p !=blockIdentsMap_.end()) {
1307  do {
1308  int ident=(p->second).first;
1309  drawGObject(ident,color,false);
1310  p++;
1311  } while (p!=blockIdentsMap_.upper_bound(blockNb));
1312  }
1313  else
1314  cout<<"DisplayManager::displayPFBlock :not found"<<endl;
1315 }
void drawGObject(int ident, int color, bool toInitialColor)
std::vector< int > selectedGObj_
graphic object containers
bool first
Definition: L1TdeRCT.cc:94
std::multimap< int, std::pair< int, int > > blockIdentsMap_
tuple cout
Definition: gather_cfg.py:121
void DisplayManager::displayPrevious ( )

Definition at line 1283 of file DisplayManager.cc.

References display(), em_, PFRootEventManager::eventNumber(), and eventNumber_.

Referenced by DialogFrame::doPreviousEvent().

1284 {
1285  int eventNumber_=em_->eventNumber();
1286  display(--eventNumber_);
1287 }
void display(int ientry)
PFRootEventManager * em_
void DisplayManager::drawGObject ( int  ident,
int  color,
bool  toInitialColor 
)
private

Definition at line 1317 of file DisplayManager.cc.

References gather_cfg::cout, displayView_, drawHO_, EHO, graphicMap_, AlCaHLTBitMon_ParallelJobs::p, query::result, and selectedGObj_.

Referenced by displayPFBlock(), findAndDraw(), and rubOutGPFBlock().

1318 {
1319  typedef std::multimap<int,GPFBase *>::const_iterator iter;
1320  iter p;
1321  std::pair<iter, iter > result = graphicMap_.equal_range(ident);
1322  if(result.first == graphicMap_.end()) {
1323  std::cout<<"pas d'objet avec cet ident: "<<ident<<std::flush<<std::endl;
1324  return;
1325  }
1326  p=result.first;
1327  while (p != result.second) {
1328  int view=p->second->getView();
1329  if (!drawHO_ && view ==EHO) continue;
1330  displayView_[view]->cd();
1331  if (toInitial) p->second->setInitialColor();
1332  else p->second->setColor(color);
1333  p->second->draw();
1334  gPad->Modified();
1335  // displayView_[view]->Update();
1336  if (!toInitial) selectedGObj_.push_back(ident);
1337  p++;
1338  }
1339 }
std::multimap< int, GPFBase * > graphicMap_
std::vector< TCanvas * > displayView_
vector of canvas for x/y or r/z display
std::vector< int > selectedGObj_
graphic object containers
tuple result
Definition: query.py:137
tuple cout
Definition: gather_cfg.py:121
void DisplayManager::drawWithNewGraphicAttributes ( )

Definition at line 1158 of file DisplayManager.cc.

References CLUSTERECALID, CLUSTERHCALID, CLUSTERHOID, CLUSTERIBID, CLUSTERPSID, displayAll(), drawHO_, graphicMap_, AlCaHLTBitMon_ParallelJobs::p, RECTRACKID, shiftId_, and SIMPARTICLEID.

Referenced by DialogFrame::modifyAttr().

1159 {
1160  std::multimap<int,GPFBase *>::iterator p;
1161 
1162  for (p=graphicMap_.begin();p!=graphicMap_.end();p++) {
1163  int ident=p->first;
1164  int type=ident >> shiftId_;
1165  if (!drawHO_ && (type==CLUSTERHOID)) continue;
1166  switch (type) {
1167  case CLUSTERECALID: case CLUSTERHCALID: case CLUSTERHOID: case CLUSTERPSID: case CLUSTERIBID:
1168  {
1169  p->second->setNewStyle();
1170  p->second->setNewSize();
1171  p->second->setColor();
1172  }
1173  break;
1174  case RECTRACKID:
1175  {
1176  p->second->setColor();
1177  p->second->setNewStyle();
1178  p->second->setNewSize();
1179  }
1180  break;
1181  case SIMPARTICLEID:
1182  {
1183  }
1184  break;
1185  default : break;
1186  } //switch end
1187  } //for end
1188  displayAll(false);
1189 }
type
Definition: HCALResponse.h:22
void displayAll(bool noRedraw=true)
std::multimap< int, GPFBase * > graphicMap_
void DisplayManager::enableDrawBrem ( bool  state)

Definition at line 1346 of file DisplayManager.cc.

References drawBrems_, and evf::utils::state.

Referenced by DialogFrame::areBremVisible().

1347 {
1348  drawBrems_=state;
1349 }
char state
Definition: procUtils.cc:75
void DisplayManager::enableDrawPFBlock ( bool  state)

Definition at line 1341 of file DisplayManager.cc.

References drawPFBlocks_, and evf::utils::state.

Referenced by DialogFrame::isPFBlockVisible().

1342 {
1344 }
char state
Definition: procUtils.cc:75
void DisplayManager::findAndDraw ( int  ident)

Definition at line 1351 of file DisplayManager.cc.

References create_public_lumi_plots::color, gather_cfg::cout, displayAll(), drawGObject(), drawHO_, drawPFBlocks_, HITTYPES, RECHITECALID, RECHITHCALID, RECHITHFEMID, RECHITHFHADID, RECHITHOID, RECHITPSID, rubOutGPFBlock(), selectedGObj_, shiftId_, SIMPARTICLEID, and updateDisplay().

Referenced by GPFCluster::ExecuteEvent(), GPFRecHit::ExecuteEvent(), GPFTrack::ExecuteEvent(), and GPFSimParticle::ExecuteEvent().

1352 {
1353  int type=ident >> shiftId_; // defined in DisplayCommon.h
1354  if (drawHO_ || type!=RECHITHOID) {
1355  int color=1;
1356  if (type>15) {
1357  std ::cout<<"DisplayManager::findAndDraw :object Type unknown"<<std::endl;
1358  return;
1359  }
1360  if (drawPFBlocks_==0 ||
1361  type==RECHITECALID || type==RECHITHCALID || type==RECHITHOID ||
1362  type==RECHITHFEMID || type==RECHITHFHADID ||
1363  type==RECHITPSID || type==SIMPARTICLEID) {
1364  rubOutGPFBlock();
1365  selectedGObj_.clear();
1366  bool toInitial=false;
1367  drawGObject(ident,color,toInitial);
1368  if (type<HITTYPES) {
1369  //redrawWithoutHits_=true;
1370  displayAll(false);
1371  //redrawWithoutHits_=false;
1372  }
1373  }
1374  updateDisplay();
1375  }
1376 }
void drawGObject(int ident, int color, bool toInitialColor)
type
Definition: HCALResponse.h:22
void displayAll(bool noRedraw=true)
std::vector< int > selectedGObj_
graphic object containers
const int HITTYPES
Definition: DisplayCommon.h:28
tuple cout
Definition: gather_cfg.py:121
bool DisplayManager::findBadBremsId ( int  ident)
private

Definition at line 1401 of file DisplayManager.cc.

References badBremsId_, and i.

Referenced by loadGGsfRecTracks(), and loadGPFBlocks().

1402 {
1403  for (unsigned i=0;i<badBremsId_.size();i++)
1404  if (badBremsId_[i]==ident) return true;
1405  return false;
1406 }
int i
Definition: DBlmapReader.cc:9
std::vector< int > badBremsId_
void DisplayManager::findBlock ( int  ident)

Definition at line 1378 of file DisplayManager.cc.

References Association::block, blockIdentsMap_, PFRootEventManager::blocks(), gather_cfg::cout, displayPFBlock(), em_, first, AlCaHLTBitMon_ParallelJobs::p, edm::second(), and updateDisplay().

Referenced by GPFCluster::ExecuteEvent(), and GPFTrack::ExecuteEvent().

1379 {
1380  int blockNb=-1;
1381  int elemNb=-1;
1382  multimap<int, pair <int,int > >::const_iterator p;
1383  for (p=blockIdentsMap_.begin();p!=blockIdentsMap_.end();p++) {
1384  int id=(p->second).first;
1385  if (id == ident) {
1386  blockNb=p->first;
1387  elemNb=(p->second).second;
1388  break;
1389  }
1390  }
1391  if (blockNb > -1) {
1392  std::cout<<"this object is element "<<elemNb<<" of PFblock nb "<<blockNb<<std::endl;
1393  assert( blockNb < static_cast<int>(em_->blocks().size()) );
1394  const reco::PFBlock& block = em_->blocks()[blockNb];
1395  std::cout<<block<<std::endl;
1396  displayPFBlock(blockNb);
1397  }
1398  updateDisplay();
1399 }
const reco::PFBlockCollection & blocks() const
void displayPFBlock(int blockNb)
PFRootEventManager * em_
U second(std::pair< T, U > const &p)
bool first
Definition: L1TdeRCT.cc:94
block
Formating index page&#39;s pieces.
Definition: Association.py:232
std::multimap< int, std::pair< int, int > > blockIdentsMap_
tuple cout
Definition: gather_cfg.py:121
Block of elements.
Definition: PFBlock.h:30
void DisplayManager::getDisplayOptions ( )
private
double DisplayManager::getMaxE ( int  layer) const
private

Definition at line 1421 of file DisplayManager.cc.

References dtNoiseDBValidation_cfg::cerr, PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, em_, PFLayer::HCAL_BARREL1, PFLayer::HCAL_BARREL2, PFLayer::HCAL_ENDCAP, PFLayer::HF_EM, PFLayer::HF_HAD, i, PFLayer::PS1, PFLayer::PS2, PFRootEventManager::rechitsECAL_, PFRootEventManager::rechitsHCAL_, PFRootEventManager::rechitsHFEM_, PFRootEventManager::rechitsHFHAD_, PFRootEventManager::rechitsHO_, and PFRootEventManager::rechitsPS_.

Referenced by getMaxEEcal(), getMaxEHcal(), and getMaxEHo().

1422 {
1423 
1424  double maxe = -9999;
1425 
1426  // in which vector should we look for these rechits ?
1427 
1428  const reco::PFRecHitCollection* vec = 0;
1429  switch(layer) {
1430  case PFLayer::ECAL_ENDCAP:
1431  case PFLayer::ECAL_BARREL:
1432  vec = &(em_->rechitsECAL_);
1433  break;
1434  case PFLayer::HCAL_ENDCAP:
1435  case PFLayer::HCAL_BARREL1:
1436  // case PFLayer::HCAL_BARREL2:
1437  vec = &(em_->rechitsHCAL_);
1438  break;
1439  case PFLayer::HCAL_BARREL2:
1440  vec = &(em_->rechitsHO_);
1441  break;
1442 
1443  case PFLayer::HF_EM:
1444  vec = &(em_->rechitsHFEM_);
1445  break;
1446  case PFLayer::HF_HAD:
1447  vec = &(em_->rechitsHFHAD_);
1448  break;
1449  case PFLayer::PS1:
1450  case PFLayer::PS2:
1451  vec = &(em_->rechitsPS_);
1452  break;
1453  default:
1454  cerr<<"DisplayManager::getMaxE : manage other layers"<<endl;
1455  return maxe;
1456  }
1457 
1458  for( unsigned i=0; i<vec->size(); i++) {
1459  if( (*vec)[i].layer() != layer ) continue;
1460  if( (*vec)[i].energy() > maxe)
1461  maxe = (*vec)[i].energy();
1462  }
1463 
1464  return maxe;
1465 }
int i
Definition: DBlmapReader.cc:9
reco::PFRecHitCollection rechitsHFHAD_
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
reco::PFRecHitCollection rechitsPS_
reco::PFRecHitCollection rechitsHCAL_
PFRootEventManager * em_
reco::PFRecHitCollection rechitsHFEM_
reco::PFRecHitCollection rechitsHO_
reco::PFRecHitCollection rechitsECAL_
double DisplayManager::getMaxEEcal ( )
private

Definition at line 1467 of file DisplayManager.cc.

References PFLayer::ECAL_BARREL, PFLayer::ECAL_ENDCAP, getMaxE(), PFLayer::HF_EM, and maxERecHitEcal_.

Referenced by loadGRecHits().

1467  {
1468 
1469  if( maxERecHitEcal_<0 ) {
1470  double maxeec = getMaxE( PFLayer::ECAL_ENDCAP );
1471  double maxeb = getMaxE( PFLayer::ECAL_BARREL );
1472  double maxehf = getMaxE( PFLayer::HF_EM );
1473  maxERecHitEcal_ = maxeec>maxeb ? maxeec:maxeb;
1475  // max of both barrel and endcap
1476  }
1477  return maxERecHitEcal_;
1478 }
double maxERecHitEcal_
double getMaxE(int layer) const
double DisplayManager::getMaxEHcal ( )
private

Definition at line 1480 of file DisplayManager.cc.

References getMaxE(), PFLayer::HCAL_BARREL1, PFLayer::HCAL_ENDCAP, PFLayer::HF_HAD, and maxERecHitHcal_.

Referenced by loadGRecHits().

1480  {
1481 
1482  if(maxERecHitHcal_ < 0) {
1483  double maxehf = getMaxE( PFLayer::HF_HAD );
1484  double maxeec = getMaxE( PFLayer::HCAL_ENDCAP );
1485  double maxeb = getMaxE( PFLayer::HCAL_BARREL1 );
1486  maxERecHitHcal_ = maxeec>maxeb ? maxeec:maxeb;
1488  }
1489  return maxERecHitHcal_;
1490 }
double getMaxE(int layer) const
double maxERecHitHcal_
double DisplayManager::getMaxEHo ( )
private

Definition at line 1493 of file DisplayManager.cc.

References getMaxE(), PFLayer::HCAL_BARREL2, and maxERecHitHo_.

1493  {
1494 
1495  if(maxERecHitHo_ < 0) {
1497  }
1498  return maxERecHitHo_;
1499 }
double getMaxE(int layer) const
void DisplayManager::loadGClusters ( )
private

Definition at line 1615 of file DisplayManager.cc.

References CLUSTERECALID, CLUSTERHCALID, CLUSTERHFEMID, CLUSTERHFHADID, CLUSTERHOID, CLUSTERPSID, PFRootEventManager::clustersECAL_, PFRootEventManager::clustersHCAL_, PFRootEventManager::clustersHFEM_, PFRootEventManager::clustersHFHAD_, PFRootEventManager::clustersHO_, PFRootEventManager::clustersPS_, createGCluster(), drawHO_, em_, i, and shiftId_.

Referenced by loadGraphicObjects().

1616 {
1617  double phi0=0;
1618 
1619  for(unsigned i=0; i<em_->clustersECAL_->size(); i++){
1620  //int clusId=(i<<shiftId_) | CLUSTERECALID;
1621  int clusId=(CLUSTERECALID<<shiftId_) | i;
1622  createGCluster( (*(em_->clustersECAL_))[i],clusId, phi0);
1623  }
1624  for(unsigned i=0; i<em_->clustersHCAL_->size(); i++) {
1625  //int clusId=(i<<shiftId_) | CLUSTERHCALID;
1626  int clusId=(CLUSTERHCALID<<shiftId_) | i;
1627  createGCluster( (*(em_->clustersHCAL_))[i],clusId, phi0);
1628  }
1629 
1630  if (drawHO_) {
1631  for(unsigned i=0; i<em_->clustersHO_->size(); i++) {
1632  //int clusId=(i<<shiftId_) | CLUSTERHOID;
1633  int clusId=(CLUSTERHOID<<shiftId_) | i;
1634  createGCluster( (*(em_->clustersHO_))[i],clusId, phi0);
1635  }
1636  }
1637 
1638  for(unsigned i=0; i<em_->clustersHFEM_->size(); i++) {
1639  //int clusId=(i<<shiftId_) | CLUSTERHFEMID;
1640  int clusId=(CLUSTERHFEMID<<shiftId_) | i;
1641  createGCluster( (*(em_->clustersHFEM_))[i],clusId, phi0);
1642  }
1643  for(unsigned i=0; i<em_->clustersHFHAD_->size(); i++) {
1644  //int clusId=(i<<shiftId_) | CLUSTERHFHADID;
1645  int clusId=(CLUSTERHFHADID<<shiftId_) | i;
1646  createGCluster( (*(em_->clustersHFHAD_))[i],clusId, phi0);
1647  }
1648  for(unsigned i=0; i<em_->clustersPS_->size(); i++){
1649  //int clusId=(i<<shiftId_) | CLUSTERPSID;
1650  int clusId=(CLUSTERPSID<<shiftId_) | i;
1651  createGCluster( (*(em_->clustersPS_))[i],clusId,phi0);
1652  }
1653 // for(unsigned i=0; i<em_->clustersIslandBarrel_.size(); i++) {
1654 // PFLayer::Layer layer = PFLayer::ECAL_BARREL;
1655 // //int clusId=(i<<shiftId_) | CLUSTERIBID;
1656 // int clusId=(CLUSTERIBID<<shiftId_) | i;
1657 
1658 // reco::PFCluster cluster( layer,
1659 // em_->clustersIslandBarrel_[i].energy(),
1660 // em_->clustersIslandBarrel_[i].x(),
1661 // em_->clustersIslandBarrel_[i].y(),
1662 // em_->clustersIslandBarrel_[i].z() );
1663 // createGCluster( cluster,clusId, phi0);
1664 // }
1665 }
int i
Definition: DBlmapReader.cc:9
void createGCluster(const reco::PFCluster &cluster, int ident, double phi0=0.)
std::auto_ptr< reco::PFClusterCollection > clustersECAL_
std::auto_ptr< reco::PFClusterCollection > clustersHCAL_
PFRootEventManager * em_
std::auto_ptr< reco::PFClusterCollection > clustersPS_
std::auto_ptr< reco::PFClusterCollection > clustersHO_
std::auto_ptr< reco::PFClusterCollection > clustersHFEM_
std::auto_ptr< reco::PFClusterCollection > clustersHFHAD_
void DisplayManager::loadGGenParticles ( )
private

Definition at line 1503 of file DisplayManager.cc.

References createGGenParticle(), em_, configurableAnalysis::GenParticle, edm::HepMCProduct::GetEvent(), PFRootEventManager::MCTruth_, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by loadGraphicObjects().

1504 {
1505 
1506  const HepMC::GenEvent* myGenEvent = em_->MCTruth_.GetEvent();
1507  if(!myGenEvent) return;
1508  for ( HepMC::GenEvent::particle_const_iterator piter = myGenEvent->particles_begin();
1509  piter != myGenEvent->particles_end();
1510  ++piter ) {
1511  HepMC::GenParticle* p = *piter;
1512 
1513  createGGenParticle(p);
1514  }
1515 }
PFRootEventManager * em_
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:35
edm::HepMCProduct MCTruth_
void createGGenParticle(HepMC::GenParticle *p)
void DisplayManager::loadGGsfRecTracks ( )
private

Definition at line 1980 of file DisplayManager.cc.

References BREMID, reco::PFTrajectoryPoint::ClosestApproach, funct::cos(), createGTrack(), reco::PFTrajectoryPoint::ECALEntrance, em_, findBadBremsId(), GSFRECTRACKID, PFRootEventManager::gsfrecTracks_, create_public_lumi_plots::linestyle, reco::PFTrajectoryPoint::momentum(), retrieveBadBrems(), and shiftId_.

Referenced by loadGraphicObjects().

1981 {
1982  double phi0=0;
1983 
1984  int ind=-1;
1985  int indbrem=-1;
1986 
1987  // allows not to draw Brems with no informations in PFBlocks
1988  retrieveBadBrems();
1989 
1990  std::vector<reco::GsfPFRecTrack>::iterator itRecTrack;
1991  for (itRecTrack = em_->gsfrecTracks_.begin(); itRecTrack != em_->gsfrecTracks_.end();itRecTrack++) {
1992  double sign = 1.;
1993  const reco::PFTrajectoryPoint& tpinitial
1994  = itRecTrack->extrapolatedPoint(reco::PFTrajectoryPoint::ClosestApproach);
1995  double pt = tpinitial.momentum().Pt();
1996  //if( pt<em_->displayRecTracksPtMin_ ) continue;
1997 
1998  const reco::PFTrajectoryPoint& tpatecal
1999  = itRecTrack->trajectoryPoint(itRecTrack->nTrajectoryMeasurements() +
2001 
2002  if ( cos(phi0 - tpatecal.momentum().Phi()) < 0.)
2003  sign = -1.;
2004 
2005  const std::vector<reco::PFTrajectoryPoint>& points =
2006  itRecTrack->trajectoryPoints();
2007 
2008  int linestyle = itRecTrack->algoType();
2009  ind++;
2010  int recTrackId=(GSFRECTRACKID <<shiftId_) | ind;
2011 
2012  createGTrack(*itRecTrack,points,recTrackId, pt, phi0, sign, false,linestyle,1);
2013 
2014  // now the Brems - bad to copy, but problems otherwise
2015  std::vector<reco::PFBrem> brems=itRecTrack->PFRecBrem();
2016  unsigned nbrems=brems.size();
2017  for(unsigned ibrem=0;ibrem<nbrems;++ibrem)
2018  {
2019  unsigned indTrajPoint=brems[ibrem].indTrajPoint();
2020  if(indTrajPoint==99) continue;
2021  double signBrem = 1. ; // this is not the charge
2022  int linestyleBrem = brems[ibrem].algoType();
2023  indbrem++;
2024  // build the index by hand. Assume that there are less 40 Brems per GSF track (ultrasafe!)
2025  // make it from the GSF index and the brem index
2026  unsigned indexBrem= ind*40+brems[ibrem].indTrajPoint();
2027  int recTrackIdBrem=(BREMID << shiftId_ ) | indexBrem;
2028 
2029  //check if there is information on this brem in the PFBlock
2030  //before creating a graphic object
2031  if (!findBadBremsId(recTrackIdBrem)) {
2032 
2033  // the vertex is not stored, need to make it by hand
2034  std::vector<reco::PFTrajectoryPoint> pointsBrem;
2035  //the first two trajectory points are dummy; copy them
2036  pointsBrem.push_back(brems[ibrem].trajectoryPoints()[0]);
2037  pointsBrem.push_back(brems[ibrem].trajectoryPoints()[1]);
2038 
2039  // then get the vertex from the GSF track
2040  pointsBrem.push_back(itRecTrack->trajectoryPoint(indTrajPoint));
2041 
2042  unsigned ntp=brems[ibrem].trajectoryPoints().size();
2043  for(unsigned itp=2;itp<ntp;++itp)
2044  {
2045  pointsBrem.push_back(brems[ibrem].trajectoryPoints()[itp]);
2046  }
2047 
2048  double deltaP=brems[ibrem].DeltaP();
2049  const reco::PFTrajectoryPoint& tpatecalbrem
2050  = brems[ibrem].trajectoryPoint(brems[ibrem].nTrajectoryMeasurements() +
2052 
2053  if ( cos(phi0 - tpatecalbrem.momentum().Phi()) < 0.)
2054  signBrem = -1.; // again, not the charge
2055 
2056  createGTrack(brems[ibrem],pointsBrem,recTrackIdBrem,deltaP,phi0,signBrem,false,linestyleBrem,2);
2057  }
2058  }
2059  }
2060 
2061 }
bool findBadBremsId(int ident)
PFRootEventManager * em_
Point of closest approach from beam axis (initial point in the case of PFSimParticle) ...
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
reco::GsfPFRecTrackCollection gsfrecTracks_
void createGTrack(reco::PFRecTrack &tr, const std::vector< reco::PFTrajectoryPoint > &points, int ident, double pt, double phi0, double sign, bool displayInitial, int linestyle, int kfgsfbrem=0)
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
void DisplayManager::loadGPFBlocks ( )
private

Definition at line 1701 of file DisplayManager.cc.

References begin, blockIdentsMap_, reco::PFBlockElement::BREM, BREMID, CLUSTERECALID, CLUSTERHCALID, CLUSTERHFEMID, CLUSTERHFHADID, CLUSTERHOID, CLUSTERIBID, CLUSTERPSID, gather_cfg::cout, drawHO_, reco::PFBlockElement::ECAL, em_, end, findBadBremsId(), reco::PFBlockElement::GSF, GSFRECTRACKID, reco::PFBlockElementBrem::GsftrackRefPF(), reco::PFBlockElementGsfTrack::GsftrackRefPF(), reco::PFBlockElement::HCAL, reco::PFBlockElement::HFEM, reco::PFBlockElement::HFHAD, reco::PFBlockElement::HO, getHLTprescales::index, reco::PFBlockElementBrem::indTrajPoint(), edm::Ref< C, T, F >::isNull(), edm::Ref< C, T, F >::key(), reco::PFBlockElement::NONE, PFRootEventManager::pfBlocks_, reco::PFBlockElement::PS1, reco::PFBlockElement::PS2, RECTRACKID, reco::PFBlockElement::SC, shiftId_, findQualityFiles::size, reco::PFBlockElementSuperCluster::superClusterRef(), and reco::PFBlockElement::TRACK.

Referenced by loadGraphicObjects().

1702 {
1703  int size = em_->pfBlocks_->size();
1704  for (int ibl=0;ibl<size;ibl++) {
1705  //int elemNb=((*(em_->pfBlocks_))[ibl].elements()).size();
1706  //std::cout<<"block "<<ibl<<":"<<elemNb<<" elements"<<std::flush<<std::endl;
1708  for( iter =((*(em_->pfBlocks_))[ibl].elements()).begin();
1709  iter != ((*(em_->pfBlocks_))[ibl].elements()).end();iter++) {
1710 
1711  //COLIN
1712 // std::cout<<"elem index "<<(*iter).index()<<"-type:"
1713 // <<(*iter).type()<<std::flush<<std::endl;
1714  int ident=-1;
1715 
1716  reco::PFBlockElement::Type type = (*iter).type();
1717  if (!drawHO_ && type==reco::PFBlockElement::HO) continue;
1718  switch (type) {
1720  assert(0);
1721  break;
1723  {
1724  reco::PFRecTrackRef trackref =(*iter).trackRefPF();
1725  assert( !trackref.isNull() );
1726  // std::cout<<" - key "<<trackref.key()<<std::flush<<std::endl<<std::endl;
1727  ident=(RECTRACKID <<shiftId_) | trackref.key();
1728  }
1729  break;
1731  {
1732  reco::PFClusterRef clusref=(*iter).clusterRef();
1733  assert( !clusref.isNull() );
1734  //std::cout<<"- key "<<clusref.key()<<std::flush<<std::endl<<std::endl;
1735  ident=(CLUSTERPSID <<shiftId_) |clusref.key();
1736  }
1737  break;
1739  {
1740  reco::PFClusterRef clusref=(*iter).clusterRef();
1741  assert( !clusref.isNull() );
1742  //std::cout<<"key "<<clusref.key()<<std::flush<<std::endl<<std::endl;
1743  ident=(CLUSTERPSID <<shiftId_) |clusref.key();
1744  }
1745  break;
1747  {
1748  reco::PFClusterRef clusref=(*iter).clusterRef();
1749  assert( !clusref.isNull() );
1750  //std::cout<<"key "<<clusref.key()<<std::flush<<std::endl<<std::endl;
1751  ident=(CLUSTERECALID <<shiftId_) |clusref.key();
1752  }
1753  break;
1755  {
1756  reco::PFClusterRef clusref=(*iter).clusterRef();
1757  assert( !clusref.isNull() );
1758  //std::cout<<"key "<<clusref.key()<<std::flush<<std::endl<<std::endl;
1759  ident=(CLUSTERHCALID <<shiftId_) |clusref.key();
1760  }
1761  break;
1762 
1764  {
1765  reco::PFClusterRef clusref=(*iter).clusterRef();
1766  assert( !clusref.isNull() );
1767  //std::cout<<"key "<<clusref.key()<<std::flush<<std::endl<<std::endl;
1768  ident=(CLUSTERHOID <<shiftId_) |clusref.key();
1769  }
1770  break;
1771 
1773  {
1774  reco::PFClusterRef clusref=(*iter).clusterRef();
1775  assert( !clusref.isNull() );
1776  //std::cout<<"key "<<clusref.key()<<std::flush<<std::endl<<std::endl;
1777  ident=(CLUSTERHFEMID <<shiftId_) |clusref.key();
1778  }
1779  break;
1781  {
1782  reco::PFClusterRef clusref=(*iter).clusterRef();
1783  assert( !clusref.isNull() );
1784  //std::cout<<"key "<<clusref.key()<<std::flush<<std::endl<<std::endl;
1785  ident=(CLUSTERHFHADID <<shiftId_) |clusref.key();
1786  }
1787  break;
1789  {
1790  const reco::PFBlockElementGsfTrack * GsfEl =
1791  dynamic_cast<const reco::PFBlockElementGsfTrack*>(&(*iter));
1792 
1793  reco::GsfPFRecTrackRef trackref=GsfEl->GsftrackRefPF();
1794  assert( !trackref.isNull() );
1795  ident=(GSFRECTRACKID << shiftId_) | trackref.key();
1796  }
1797  break;
1799  {
1800  const reco::PFBlockElementBrem * Brem = dynamic_cast<const reco::PFBlockElementBrem*>(&(*iter));
1801  reco::GsfPFRecTrackRef trackref = Brem->GsftrackRefPF();
1802  unsigned index=trackref.key()*40+Brem->indTrajPoint();
1803  ident = (BREMID << shiftId_ ) | index ;
1804  if (findBadBremsId(ident)) ident=-1;
1805  }
1806  break;
1807 
1809  {
1810  const reco::PFBlockElementSuperCluster * sc = dynamic_cast<const reco::PFBlockElementSuperCluster*>(&(*iter));
1811  reco::SuperClusterRef scref = sc->superClusterRef();
1812  assert( !scref.isNull() );
1813  ident = (CLUSTERIBID << shiftId_ ) | scref.key();
1814  }
1815  break;
1816 
1817  default:
1818  std::cout<<"unknown PFBlock element of type "<<type<<std::endl;
1819  break;
1820  } //end switch
1821  pair <int, int> idElem;
1822  idElem.first=ident;
1823  idElem.second=(*iter).index();
1824  if (ident != -1) blockIdentsMap_.insert(pair<int,pair <int,int> > (ibl,idElem));
1825  } //end for elements
1826  } //end for blocks
1827 
1828 }
std::auto_ptr< reco::PFBlockCollection > pfBlocks_
reconstructed pfblocks
type
Definition: HCALResponse.h:22
bool findBadBremsId(int ident)
GsfPFRecTrackRef GsftrackRefPF() const
unsigned int indTrajPoint() const
PFRootEventManager * em_
bool isNull() const
Checks for null.
Definition: Ref.h:247
#define end
Definition: vmac.h:38
std::multimap< int, std::pair< int, int > > blockIdentsMap_
key_type key() const
Accessor for product key.
Definition: Ref.h:266
#define begin
Definition: vmac.h:31
GsfPFRecTrackRef GsftrackRefPF() const
tuple cout
Definition: gather_cfg.py:121
tuple size
Write out results.
void DisplayManager::loadGraphicObjects ( )
private
void DisplayManager::loadGRecHits ( )
private

Definition at line 1841 of file DisplayManager.cc.

References dtNoiseDBValidation_cfg::cerr, PFRootEventManager::clusterAlgoECAL_, PFRootEventManager::clusterAlgoHCAL_, PFRootEventManager::clusterAlgoHFEM_, PFRootEventManager::clusterAlgoHFHAD_, PFRootEventManager::clusterAlgoHO_, PFRootEventManager::clusterAlgoPS_, PFClusterAlgo::color(), create_public_lumi_plots::color, createGRecHit(), drawHO_, em_, getMaxEEcal(), getMaxEHcal(), i, RECHITHCALID, RECHITHFEMID, RECHITHFHADID, RECHITHOID, RECHITPSID, PFRootEventManager::rechitsECAL_, PFRootEventManager::rechitsHCAL_, PFRootEventManager::rechitsHFEM_, PFRootEventManager::rechitsHFHAD_, PFRootEventManager::rechitsHO_, PFRootEventManager::rechitsPS_, PFClusterAlgo::SEED, shiftId_, and PFClusterAlgo::SPECIAL.

Referenced by loadGraphicObjects().

1842 {
1843  double phi0=0;
1844 
1845  double maxee = getMaxEEcal();
1846  double maxeh = getMaxEHcal();
1847  double maxe = maxee>maxeh ? maxee : maxeh;
1848 
1849  int color = TColor::GetColor(210,210,210);
1850  int seedcolor = TColor::GetColor(145,145,145);
1851  int specialcolor = TColor::GetColor(255,140,0);
1852 
1853  for(unsigned i=0; i<em_->rechitsECAL_.size(); i++) {
1854  int rhcolor = color;
1855  if( unsigned col = em_->clusterAlgoECAL_.color(i) ) {
1856  switch(col) {
1857  case PFClusterAlgo::SEED: rhcolor = seedcolor; break;
1858  case PFClusterAlgo::SPECIAL: rhcolor = specialcolor; break;
1859  default:
1860  cerr<<"DisplayManager::loadGRecHits: unknown color"<<endl;
1861  }
1862  }
1863  //int recHitId=(i<<shiftId_) | RECHITECALID;
1864  int recHitId=i;
1865  createGRecHit(em_->rechitsECAL_[i],recHitId, maxe, phi0, rhcolor);
1866  }
1867 
1868  for(unsigned i=0; i<em_->rechitsHCAL_.size(); i++) {
1869  int rhcolor = color;
1870  if(unsigned col = em_->clusterAlgoHCAL_.color(i) ) {
1871  switch(col) {
1872  case PFClusterAlgo::SEED: rhcolor = seedcolor; break;
1873  case PFClusterAlgo::SPECIAL: rhcolor = specialcolor; break;
1874  default:
1875  cerr<<"DisplayManager::loadGRecHits: unknown color"<<endl;
1876  }
1877  }
1878  //int recHitId=(i<<shiftId_) | RECHITHCALID;
1879  int recHitId=(RECHITHCALID <<shiftId_) | i;
1880  createGRecHit(em_->rechitsHCAL_[i],recHitId, maxe, phi0, rhcolor);
1881  }
1882 
1883  if (drawHO_) {
1884  for(unsigned i=0; i<em_->rechitsHO_.size(); i++) {
1885  int rhcolor = color;
1886  if(unsigned col = em_->clusterAlgoHO_.color(i) ) {
1887  switch(col) {
1888  case PFClusterAlgo::SEED: rhcolor = seedcolor; break;
1889  case PFClusterAlgo::SPECIAL: rhcolor = specialcolor; break;
1890  default:
1891  cerr<<"DisplayManager::loadGRecHits: unknown color"<<endl;
1892  }
1893  }
1894  //int recHitId=(i<<shiftId_) | RECHITHOID;
1895  int recHitId=(RECHITHOID <<shiftId_) | i;
1896  createGRecHit(em_->rechitsHO_[i],recHitId, 2*maxe, phi0, rhcolor);
1897  }
1898  }
1899 
1900  for(unsigned i=0; i<em_->rechitsHFEM_.size(); i++) {
1901  int rhcolor = color;
1902  if(unsigned col = em_->clusterAlgoHFEM_.color(i) ) {
1903  switch(col) {
1904  case PFClusterAlgo::SEED: rhcolor = seedcolor; break;
1905  case PFClusterAlgo::SPECIAL: rhcolor = specialcolor; break;
1906  default:
1907  cerr<<"DisplayManager::loadGRecHits: unknown color"<<endl;
1908  }
1909  }
1910  //int recHitId=(i<<shiftId_) | RECHITHFEMID;
1911  int recHitId=(RECHITHFEMID <<shiftId_) | i;
1912  createGRecHit(em_->rechitsHFEM_[i],recHitId, maxe, phi0, rhcolor);
1913  }
1914 
1915  for(unsigned i=0; i<em_->rechitsHFHAD_.size(); i++) {
1916  int rhcolor = color;
1917  if(unsigned col = em_->clusterAlgoHFHAD_.color(i) ) {
1918  switch(col) {
1919  case PFClusterAlgo::SEED: rhcolor = seedcolor; break;
1920  case PFClusterAlgo::SPECIAL: rhcolor = specialcolor; break;
1921  default:
1922  cerr<<"DisplayManager::loadGRecHits: unknown color"<<endl;
1923  }
1924  }
1925  //int recHitId=(i<<shiftId_) | RECHITHFHADID;
1926  int recHitId=(RECHITHFHADID <<shiftId_) | i;
1927  createGRecHit(em_->rechitsHFHAD_[i],recHitId, maxe, phi0, rhcolor);
1928  }
1929 
1930  for(unsigned i=0; i<em_->rechitsPS_.size(); i++) {
1931  int rhcolor = color;
1932  if( unsigned col = em_->clusterAlgoPS_.color(i) ) {
1933  switch(col) {
1934  case PFClusterAlgo::SEED: rhcolor = seedcolor; break;
1935  case PFClusterAlgo::SPECIAL: rhcolor = specialcolor; break;
1936  default:
1937  cerr<<"DisplayManager::loadGRecHits: unknown color"<<endl;
1938  }
1939  }
1940  //int recHitId=(i<<shiftId_) | RECHITPSID;
1941  int recHitId=(RECHITPSID<<shiftId_) | i;
1942 
1943  createGRecHit(em_->rechitsPS_[i],recHitId, maxe, phi0, rhcolor);
1944  }
1945 }
int i
Definition: DBlmapReader.cc:9
PFClusterAlgo clusterAlgoHFEM_
clustering algorithm for HF, electro-magnetic layer
PFClusterAlgo clusterAlgoHO_
clustering algorithm for HO
reco::PFRecHitCollection rechitsHFHAD_
PFClusterAlgo clusterAlgoECAL_
reco::PFRecHitCollection rechitsPS_
reco::PFRecHitCollection rechitsHCAL_
PFRootEventManager * em_
PFClusterAlgo clusterAlgoHCAL_
clustering algorithm for HCAL
void createGRecHit(reco::PFRecHit &rh, int ident, double maxe, double phi0=0., int color=4)
reco::PFRecHitCollection rechitsHFEM_
reco::PFRecHitCollection rechitsHO_
PFClusterAlgo clusterAlgoPS_
clustering algorithm for PS
reco::PFRecHitCollection rechitsECAL_
PFClusterAlgo clusterAlgoHFHAD_
clustering algorithm for HF, hadronic layer
unsigned color(unsigned rhi) const
void DisplayManager::loadGRecTracks ( )
private

Definition at line 1947 of file DisplayManager.cc.

References reco::PFTrajectoryPoint::ClosestApproach, funct::cos(), createGTrack(), reco::PFTrajectoryPoint::ECALEntrance, em_, create_public_lumi_plots::linestyle, reco::PFTrajectoryPoint::momentum(), RECTRACKID, PFRootEventManager::recTracks_, and shiftId_.

Referenced by loadGraphicObjects().

1948 {
1949  double phi0=0;
1950 
1951  int ind=-1;
1952  std::vector<reco::PFRecTrack>::iterator itRecTrack;
1953  for (itRecTrack = em_->recTracks_.begin(); itRecTrack != em_->recTracks_.end();itRecTrack++) {
1954  double sign = 1.;
1955  const reco::PFTrajectoryPoint& tpinitial
1956  = itRecTrack->extrapolatedPoint(reco::PFTrajectoryPoint::ClosestApproach);
1957  double pt = tpinitial.momentum().Pt();
1958  //if( pt<em_->displayRecTracksPtMin_ ) continue;
1959 
1960  const reco::PFTrajectoryPoint& tpatecal
1961  = itRecTrack->trajectoryPoint(itRecTrack->nTrajectoryMeasurements() +
1963 
1964  if ( cos(phi0 - tpatecal.momentum().Phi()) < 0.)
1965  sign = -1.;
1966 
1967  const std::vector<reco::PFTrajectoryPoint>& points =
1968  itRecTrack->trajectoryPoints();
1969 
1970  int linestyle = itRecTrack->algoType();
1971  ind++;
1972  //int recTrackId=(ind<<shiftId_) | RECTRACKID;
1973  int recTrackId=(RECTRACKID <<shiftId_) | ind;
1974 
1975  createGTrack(*itRecTrack,points,recTrackId, pt, phi0, sign, false,linestyle);
1976  }
1977 }
reco::PFRecTrackCollection recTracks_
PFRootEventManager * em_
Point of closest approach from beam axis (initial point in the case of PFSimParticle) ...
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void createGTrack(reco::PFRecTrack &tr, const std::vector< reco::PFTrajectoryPoint > &points, int ident, double pt, double phi0, double sign, bool displayInitial, int linestyle, int kfgsfbrem=0)
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
void DisplayManager::loadGSimParticles ( )
private

Definition at line 2064 of file DisplayManager.cc.

References abs, reco::PFTrajectoryPoint::ClosestApproach, createGPart(), em_, reco::PFTrack::extrapolatedPoint(), i, reco::PFTrajectoryPoint::momentum(), reco::PFSimParticle::motherId(), reco::PFSimParticle::pdgCode(), reco::PFTrajectoryPoint::position(), shiftId_, SIMPARTICLEID, reco::PFTrack::trajectoryPoint(), reco::PFTrack::trajectoryPoints(), and PFRootEventManager::trueParticles_.

Referenced by loadGraphicObjects().

2065 {
2066  double phi0=0;
2067  // bool debug_loadGSim = true;
2068  unsigned simParticlesVSize = em_->trueParticles_.size();
2069 
2070  for(unsigned i=0; i<simParticlesVSize; i++) {
2071 
2072  const reco::PFSimParticle& ptc = em_->trueParticles_[i];
2073 
2074  const reco::PFTrajectoryPoint& tpinitial
2076 
2077  double pt = tpinitial.momentum().Pt();
2078  //if( pt<em_->getDisplayTrueParticlesPtMin()) continue;
2079 
2080  double sign = 1.;
2081  const reco::PFTrajectoryPoint& tpFirst = ptc.trajectoryPoint(0);
2082  if ( tpFirst.position().X() < 0. )
2083  sign = -1.;
2084  //double sign2 = 1.;
2085  // if position vector is 0,0,0: X component is undefined (MDN 11 June 2008)
2086  // const reco::PFTrajectoryPoint& tpFirst = ptc.trajectoryPoint(0);
2087  // if ( tpFirst.positionXYZ().X() < 0. )
2088  // sign2 = -1.;
2089 
2090  const std::vector<reco::PFTrajectoryPoint>& points =
2091  ptc.trajectoryPoints();
2092 
2093 
2094  int indexMarker;
2095  switch( std::abs(ptc.pdgCode() ) ) {
2096  case 22: indexMarker=0; break; // photons
2097  case 11: indexMarker=1; break; // electrons
2098  case 13: indexMarker=2; break; // muons
2099  case 130:
2100  case 321: indexMarker=3; break; // K
2101  case 211: indexMarker=4; break; // pi+/pi-
2102  case 2212: indexMarker=5; break; // protons
2103  case 2112: indexMarker=6; break; // neutrons
2104  default: indexMarker=7; break;
2105  }
2106 
2107  bool displayInitial=true;
2108  if( ptc.motherId() < 0 ) displayInitial=false;
2109  int partId=(SIMPARTICLEID << shiftId_) | i;
2110  createGPart(ptc, points,partId, pt, phi0, sign, displayInitial,indexMarker);
2111  //cout << " sign " << sign << " sign2 " << sign2 << endl;
2112  //if ( sign*sign2 <0 ) cout << " ++++++Warning sign*sign2 <0 ++++++++++++++++++ " << endl;
2113 
2114  }
2115 }
int i
Definition: DBlmapReader.cc:9
const math::XYZPoint & position() const
cartesian position (x, y, z)
#define abs(x)
Definition: mlp_lapack.h:159
int pdgCode() const
Definition: PFSimParticle.h:35
void createGPart(const reco::PFSimParticle &ptc, const std::vector< reco::PFTrajectoryPoint > &points, int ident, double pt, double phi0, double sign, bool displayInitial, int markerIndex)
PFRootEventManager * em_
reco::PFSimParticleCollection trueParticles_
Point of closest approach from beam axis (initial point in the case of PFSimParticle) ...
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:76
true particle for particle flow
Definition: PFSimParticle.h:19
const std::vector< reco::PFTrajectoryPoint > & trajectoryPoints() const
Definition: PFTrack.h:98
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
const reco::PFTrajectoryPoint & trajectoryPoint(unsigned index) const
Definition: PFTrack.h:102
int motherId() const
Definition: PFSimParticle.h:41
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
void DisplayManager::lookForGenParticle ( unsigned  barcode)

look for particle with index i in MC truth.

Definition at line 2180 of file DisplayManager.cc.

References dtNoiseDBValidation_cfg::cerr, displayHist_, displayView_, drawHO_, EHO, em_, EPE, EPH, eta(), event(), configurableAnalysis::GenParticle, edm::HepMCProduct::GetEvent(), PFRootEventManager::MCTruth_, phi, and zoomFactor_.

Referenced by DialogFrame::doLookForGenParticle().

2180  {
2181 
2182  const HepMC::GenEvent* event = em_->MCTruth_.GetEvent();
2183  if(!event) {
2184  cerr<<"no GenEvent"<<endl;
2185  return;
2186  }
2187 
2188  const HepMC::GenParticle* particle = event->barcode_to_particle(barcode);
2189  if(!particle) {
2190  cerr<<"no particle with barcode "<<barcode<<endl;
2191  return;
2192  }
2193 
2194  math::XYZTLorentzVector momentum(particle->momentum().px(),
2195  particle->momentum().py(),
2196  particle->momentum().pz(),
2197  particle->momentum().e());
2198 
2199  double eta = momentum.Eta();
2200  double phi = momentum.phi();
2201 
2202  double phisize = 0.05;
2203  double etasize = 0.05;
2204 
2205  double etagate = zoomFactor_ * etasize;
2206  double phigate = zoomFactor_ * phisize;
2207 
2208  if(displayHist_[EPE]) {
2209  displayHist_[EPE]->GetXaxis()->SetRangeUser(eta-etagate, eta+etagate);
2210  displayHist_[EPE]->GetYaxis()->SetRangeUser(phi-phigate, phi+phigate);
2211  displayView_[EPE]->Modified();
2212  displayView_[EPE]->Update();
2213 
2214  }
2215  if(displayHist_[EPH]) {
2216  displayHist_[EPH]->GetXaxis()->SetRangeUser(eta-etagate, eta+etagate);
2217  displayHist_[EPH]->GetYaxis()->SetRangeUser(phi-phigate, phi+phigate);
2218  displayView_[EPH]->Modified();
2219  displayView_[EPH]->Update();
2220  }
2221 
2222  if(drawHO_ && displayHist_[EHO]) {
2223  displayHist_[EHO]->GetXaxis()->SetRangeUser(eta-etagate, eta+etagate);
2224  displayHist_[EHO]->GetYaxis()->SetRangeUser(phi-phigate, phi+phigate);
2225  displayView_[EHO]->Modified();
2226  displayView_[EHO]->Update();
2227  }
2228 
2229 }
std::vector< TCanvas * > displayView_
vector of canvas for x/y or r/z display
T eta() const
PFRootEventManager * em_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:30
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:35
edm::HepMCProduct MCTruth_
std::vector< TH2F * > displayHist_
support histogram for x/y or r/z display.
Definition: DDAxes.h:10
void DisplayManager::lookForMaxRecHit ( bool  ecal)

look for rechit with max energy in ecal or hcal.

Definition at line 2117 of file DisplayManager.cc.

References displayHist_, displayView_, drawHO_, EHO, em_, relval_parameters_module::energy, EPE, EPH, eta(), i, phi, reco::PFRecHit::position(), HI_PhotonSkim_cff::rechits, PFRootEventManager::rechitsECAL_, PFRootEventManager::rechitsHCAL_, reco::PFRecHit::size(), and zoomFactor_.

2118 {
2119  // look for the rechit with max e in ecal or hcal
2120  double maxe = -999;
2121  reco::PFRecHit* maxrh = 0;
2122 
2124  if(ecal) rechits = &(em_->rechitsECAL_);
2125  else rechits = &(em_->rechitsHCAL_);
2126  assert(rechits);
2127 
2128  for(unsigned i=0; i<(*rechits).size(); i++) {
2129 
2130  double energy = (*rechits)[i].energy();
2131 
2132  if(energy > maxe ) {
2133  maxe = energy;
2134  maxrh = &((*rechits)[i]);
2135  }
2136  }
2137 
2138  if(!maxrh) return;
2139 
2140  // center view on this rechit
2141 
2142 
2143  // get the cell size to set the eta and phi width
2144  // of the display window from one of the cells
2145 
2146  double phisize = -1;
2147  double etasize = -1;
2148  maxrh->size(phisize, etasize);
2149 
2150  double etagate = zoomFactor_ * etasize;
2151  double phigate = zoomFactor_ * phisize;
2152 
2153  double eta = maxrh->position().Eta();
2154  double phi = maxrh->position().Phi();
2155 
2156  if(displayHist_[EPE]) {
2157  displayHist_[EPE]->GetXaxis()->SetRangeUser(eta-etagate, eta+etagate);
2158  displayHist_[EPE]->GetYaxis()->SetRangeUser(phi-phigate, phi+phigate);
2159  displayView_[EPE]->Modified();
2160  displayView_[EPE]->Update();
2161  }
2162 
2163  if(displayHist_[EPH]) {
2164  displayHist_[EPH]->GetXaxis()->SetRangeUser(eta-etagate, eta+etagate);
2165  displayHist_[EPH]->GetYaxis()->SetRangeUser(phi-phigate, phi+phigate);
2166  displayView_[EPH]->Modified();
2167  displayView_[EPH]->Update();
2168  }
2169 
2170  if(drawHO_ && displayHist_[EHO]) {
2171  displayHist_[EHO]->GetXaxis()->SetRangeUser(eta-etagate, eta+etagate);
2172  displayHist_[EHO]->GetYaxis()->SetRangeUser(phi-phigate, phi+phigate);
2173  displayView_[EHO]->Modified();
2174  displayView_[EHO]->Update();
2175  }
2176 
2177 
2178 }
int i
Definition: DBlmapReader.cc:9
std::vector< TCanvas * > displayView_
vector of canvas for x/y or r/z display
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
T eta() const
reco::PFRecHitCollection rechitsHCAL_
PFRootEventManager * em_
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
void size(double &deta, double &dphi) const
Definition: PFRecHit.cc:266
const math::XYZPoint & position() const
is seed ?
Definition: PFRecHit.h:135
reco::PFRecHitCollection rechitsECAL_
std::vector< TH2F * > displayHist_
support histogram for x/y or r/z display.
Definition: DDAxes.h:10
void DisplayManager::printDisplay ( const char *  directory = "") const

Definition at line 2231 of file DisplayManager.cc.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, createBeamHaloJobs::directory, displayView_, em_, eventNumber_, mergeVDriftHistosByStation::name, dbtoconf::out, and PFRootEventManager::print().

2232 {
2233  string directory = sdirectory;
2234  if( directory.empty() ) {
2235  directory = "Event_";
2236  }
2237  char num[10];
2238  sprintf(num,"%d", eventNumber_);
2239  directory += num;
2240 
2241  string mkdir = "mkdir "; mkdir += directory;
2242  int code = system( mkdir.c_str() );
2243 
2244  if( code ) {
2245  cerr<<"cannot create directory "<<directory<<endl;
2246  return;
2247  }
2248 
2249  cout<<"Event display printed in directory "<<directory<<endl;
2250 
2251  directory += "/";
2252 
2253  for(unsigned iView=0; iView<displayView_.size(); iView++) {
2254  if( !displayView_[iView] ) continue;
2255 
2256  string name = directory;
2257  name += displayView_[iView]->GetName();
2258 
2259  cout<<displayView_[iView]->GetName()<<endl;
2260 
2261  string eps = name; eps += ".eps";
2262  displayView_[iView]->SaveAs( eps.c_str() );
2263 
2264  string png = name; png += ".png";
2265  displayView_[iView]->SaveAs( png.c_str() );
2266  }
2267 
2268  string txt = directory;
2269  txt += "event.txt";
2270  ofstream out( txt.c_str() );
2271  if( !out )
2272  cerr<<"cannot open "<<txt<<endl;
2273  em_->print( out );
2274 }
std::vector< TCanvas * > displayView_
vector of canvas for x/y or r/z display
PFRootEventManager * em_
void print(std::ostream &out=std::cout, int maxNLines=-1) const
print information
tuple out
Definition: dbtoconf.py:99
long long int num
Definition: procUtils.cc:71
tuple cout
Definition: gather_cfg.py:121
void DisplayManager::printGenParticleInfo ( std::string  name,
int  barcode,
int  barcodeMother 
)

Definition at line 2320 of file DisplayManager.cc.

References gather_cfg::cout, em_, configurableAnalysis::GenParticle, edm::HepMCProduct::GetEvent(), PFRootEventManager::MCTruth_, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by GPFGenParticle::Print().

2321 {
2322  const HepMC::GenEvent* myGenEvent = em_->MCTruth_.GetEvent();
2323  HepMC::GenParticle *p = myGenEvent->barcode_to_particle(barcode);
2324  std::cout<<"genParticle "<<name<<" with barcode "<<barcode<<std::flush<<std::endl;
2325  p->print();
2326  if (barcodeMother) {
2327  HepMC:: GenParticle *mother = myGenEvent->barcode_to_particle(barcodeMother);
2328  std::cout<<"mother particle with barcode "<<barcodeMother<<std::flush<<std::endl;
2329  mother->print();
2330  }
2331 }
PFRootEventManager * em_
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:35
edm::HepMCProduct MCTruth_
tuple cout
Definition: gather_cfg.py:121
void DisplayManager::readOptions ( const char *  file)

Definition at line 65 of file DisplayManager.cc.

References bremAttributes_, bremPatternL_, bremPatternM_, dtNoiseDBValidation_cfg::cerr, clusEnMin_, clusPattern_, clusPatternecal_, clusPatternhfem_, clusPatternho_, clusPSPattern_, clusterAttributes_, gather_cfg::cout, drawBrems_, drawClus_, drawClusterL_, drawGenParticles_, drawGsfTracks_, drawHits_, drawHO_, drawParticles_, drawPFBlocks_, drawTracks_, genParticlePtMin_, genPartPattern_, IO::GetOpt(), gsfAttributes_, gsfPatternL_, gsfPatternM_, gsfPtMin_, hitEnMin_, options_, particlePtMin_, setNewAttrToSimParticles(), simPartPatternDefault_, simPartPatternElec_, simPartPatternK_, simPartPatternL_, simPartPatternM_, simPartPatternMuon_, simPartPatternNeutron_, simPartPatternPhoton_, simPartPatternPi_, simPartPatternProton_, trackAttributes_, trackPatternL_, trackPatternM_, trackPtMin_, viewSize_, viewSizeEtaPhi_, and zoomFactor_.

Referenced by DisplayManager().

65  {
66 
67  try {
68  delete options_;
69  options_ = new IO(optfile);
70  }
71  catch( const string& err ) {
72  cout<<err<<endl;
73  return;
74  }
75 
76  drawHO_=true;
77  options_->GetOpt("display", "drawHO", drawHO_);
78 
79 
80 
81  viewSizeEtaPhi_.clear();
82  options_->GetOpt("display", "viewsize_etaphi", viewSizeEtaPhi_);
83  if(viewSizeEtaPhi_.size() != 2) {
84  cerr<<"PFRootEventManager::ReadOptions, bad display/viewsize_etaphi tag...using 700/350"
85  <<endl;
86  viewSizeEtaPhi_.clear();
87  viewSizeEtaPhi_.push_back(700);
88  viewSizeEtaPhi_.push_back(350);
89  }
90 
91  viewSize_.clear();
92  options_->GetOpt("display", "viewsize_xy", viewSize_);
93  if(viewSize_.size() != 2) {
94  cerr<<"PFRootEventManager::ReadOptions, bad display/viewsize_xy tag...using 700/350"
95  <<endl;
96  viewSize_.clear();
97  viewSize_.push_back(600);
98  viewSize_.push_back(600);
99  }
100 
101  clusterAttributes_.clear();
102  options_->GetOpt("display", "cluster_attributes", clusterAttributes_);
103  if(clusterAttributes_.size() != 7) {
104  cerr<<"PFRootEventManager::::ReadOptions, bad display/cluster_attributes tag...using 20 10 2 5"
105  <<endl;
106  clusterAttributes_.clear();
107  clusterAttributes_.push_back(2); //color
108  clusterAttributes_.push_back(5); // color if clusterPS
109  clusterAttributes_.push_back(20); // marker style
110  clusterAttributes_.push_back(1.0);
111  clusterAttributes_.push_back(6); //For ECAL
112  clusterAttributes_.push_back(9); //For HF_EM
113  clusterAttributes_.push_back(46); //For HO
114  }
115 
116  trackAttributes_.clear();
117  options_->GetOpt("display", "track_attributes", trackAttributes_);
118  if(trackAttributes_.size() != 4) {
119  cerr<<"PFRootEventManager::::ReadOptions, bad display/track_attributes tag...using 103 1 8 8"
120  <<endl;
121  trackAttributes_.clear();
122  trackAttributes_.push_back(103); //color Line and Marker
123  trackAttributes_.push_back(1); //line style
124  trackAttributes_.push_back(8); //Marker style
125  trackAttributes_.push_back(1.0); //Marker size
126  }
127  gsfAttributes_.clear();
128  options_->GetOpt("display", "gsf_attributes", gsfAttributes_);
129  if(gsfAttributes_.size() != 4) {
130  cerr<<"PFRootEventManager::::ReadOptions, bad display/gsf_attributes tag...using 105 1 8 8"
131  <<endl;
132  gsfAttributes_.clear();
133  gsfAttributes_.push_back(105); //color Line and Marker
134  gsfAttributes_.push_back(1); //line style
135  gsfAttributes_.push_back(8); //Marker style
136  gsfAttributes_.push_back(1.0); //Marker size
137  }
138  bremAttributes_.clear();
139  options_->GetOpt("display", "brem_attributes", bremAttributes_);
140  if(bremAttributes_.size() != 4) {
141  cerr<<"PFRootEventManager::::ReadOptions, bad display/gsf_attributes tag...using 106 1 8 8"
142  <<endl;
143  bremAttributes_.clear();
144  bremAttributes_.push_back(106); //color Line and Marker
145  bremAttributes_.push_back(1); //line style
146  bremAttributes_.push_back(8); //Marker style
147  bremAttributes_.push_back(1.0); //Marker size
148  }
149 
150  double attrScale = (drawHO_) ? 0.8 : 1.0;
151 
152  clusPattern_ = new TAttMarker( (int)clusterAttributes_[0],
153  (int)clusterAttributes_[2],
154  attrScale*clusterAttributes_[3]);
155 
156  clusPatternecal_ = new TAttMarker( (int)clusterAttributes_[4],
157  (int)clusterAttributes_[2],
158  attrScale*clusterAttributes_[3]);
159 
160  clusPatternhfem_ = new TAttMarker( (int)clusterAttributes_[5],
161  (int)clusterAttributes_[2],
162  attrScale*clusterAttributes_[3]);
163 
164  clusPatternho_ = new TAttMarker( (int)clusterAttributes_[6],
165  (int)clusterAttributes_[2],
166  attrScale*clusterAttributes_[3]);
167 
168  clusPSPattern_ = new TAttMarker( (int)clusterAttributes_[1],
169  (int)clusterAttributes_[2],
170  attrScale*clusterAttributes_[3]);
171  trackPatternL_ = new TAttLine( (int)trackAttributes_[0],
172  (int)trackAttributes_[1],
173  1);
174  trackPatternM_ = new TAttMarker( (int)trackAttributes_[0],
175  (int)trackAttributes_[2],
176  attrScale*trackAttributes_[3]);
177 
178  gsfPatternL_ = new TAttLine( (int)gsfAttributes_[0],
179  (int)gsfAttributes_[1],
180  1);
181  gsfPatternM_ = new TAttMarker( (int)gsfAttributes_[0],
182  (int)gsfAttributes_[2],
183  attrScale*gsfAttributes_[3]);
184 
185  bremPatternL_ = new TAttLine( (int)bremAttributes_[0],
186  (int)bremAttributes_[1],
187  1);
188  bremPatternM_ = new TAttMarker( (int)bremAttributes_[0],
189  (int)bremAttributes_[2],
190  attrScale*bremAttributes_[3]);
191 
192  genPartPattern_= new TAttMarker(kGreen-1,22,1.);
193 
194 
195  std::vector<float> simPartAttributes;
196 
197  simPartAttributes.clear();
198  options_->GetOpt("display", "simPart_attributes", simPartAttributes);
199  if(simPartAttributes.size() != 3) {
200  cerr<<"PFRootEventManager::::ReadOptions, bad display/simPart_attributes tag...using 103 1 8 8"
201  <<endl;
202  simPartAttributes.clear();
203  simPartAttributes.push_back(3); //color Line and Marker
204  simPartAttributes.push_back(2); //line style
205  simPartAttributes.push_back(0.6);
206  }
207 
208  int simColor = (int)simPartAttributes[0];
209  int simLStyle = (int)simPartAttributes[1];
210  float simMSize = attrScale*simPartAttributes[2];
211 
212  simPartPatternPhoton_ = new TAttMarker(simColor,3,simMSize);
213  simPartPatternElec_ = new TAttMarker(simColor,5,simMSize);
214  simPartPatternMuon_ = new TAttMarker(simColor,2,simMSize);
215  simPartPatternK_ = new TAttMarker(simColor,24,simMSize);
216  simPartPatternPi_ = new TAttMarker(simColor,25,simMSize);
217  simPartPatternProton_ = new TAttMarker(simColor,26,simMSize);
218  simPartPatternNeutron_= new TAttMarker(simColor,27,simMSize);
219  simPartPatternDefault_= new TAttMarker(simColor,30,simMSize);
220 
221  simPartPatternL_ = new TAttLine(simColor,simLStyle,1);
222  simPartPatternM_.resize(8);
223 
225 
226  drawHits_= true;
227  options_->GetOpt("display", "rechits",drawHits_);
228 
229  drawClus_ = true;
230  options_->GetOpt("display", "clusters",drawClus_);
231 
232  drawClusterL_ = false;
233  options_->GetOpt("display", "cluster_lines", drawClusterL_);
234 
235  drawTracks_ = true;
236  options_->GetOpt("display", "rectracks", drawTracks_);
237 
238  drawGsfTracks_ = true;
239  options_->GetOpt("display", "gsftracks", drawGsfTracks_);
240 
241  drawBrems_ = false;
242  options_->GetOpt("display", "brems", drawBrems_);
243 
244  drawParticles_ = true;
245  options_->GetOpt("display", "particles", drawParticles_);
246 
247  particlePtMin_ = -1;
248  options_->GetOpt("display", "particles_ptmin", particlePtMin_);
249 
250 
251  drawGenParticles_=false;
252  genParticlePtMin_ = 0;
253 
254 
255  trackPtMin_ = -1;
256  options_->GetOpt("display", "rectracks_ptmin", trackPtMin_);
257 
258  gsfPtMin_ = -1;
259  options_->GetOpt("display", "gsfrectracks_ptmin", gsfPtMin_);
260 
261  hitEnMin_ = -1;
262  options_->GetOpt("display","rechits_enmin",hitEnMin_);
263 
264  clusEnMin_ = -1;
265  options_->GetOpt("display","clusters_enmin",clusEnMin_);
266 
267 
268  drawPFBlocks_ = false;
269  options_->GetOpt("display","drawPFBlock",drawPFBlocks_);
270  //redrawWithoutHits_=false;
271 
272  zoomFactor_ = 10;
273  options_->GetOpt("display", "zoom_factor", zoomFactor_);
274 
275 }
General option file parser.
Definition: IO.h:28
void setNewAttrToSimParticles()
std::vector< float > gsfAttributes_
TAttMarker * genPartPattern_
TAttMarker * gsfPatternM_
TAttLine * trackPatternL_
std::vector< TAttMarker * > simPartPatternM_
TAttMarker * clusPatternhfem_
std::vector< float > trackAttributes_
TAttMarker * trackPatternM_
TAttMarker * clusPSPattern_
bool GetOpt(const char *tag, const char *key, std::vector< T > &values) const
reads a vector of T
Definition: IO.h:106
TAttMarker * simPartPatternPi_
TAttMarker * clusPatternecal_
TAttMarker * bremPatternM_
double particlePtMin_
TAttMarker * simPartPatternProton_
std::vector< float > bremAttributes_
TAttMarker * simPartPatternPhoton_
TAttMarker * simPartPatternElec_
std::vector< float > clusterAttributes_
TAttMarker * clusPattern_
TAttMarker * simPartPatternMuon_
TAttLine * gsfPatternL_
TAttLine * bremPatternL_
IO * options_
options file parser
TAttLine * simPartPatternL_
tuple cout
Definition: gather_cfg.py:121
TAttMarker * simPartPatternNeutron_
double genParticlePtMin_
TAttMarker * simPartPatternK_
TAttMarker * simPartPatternDefault_
std::vector< int > viewSize_
display pad xy size for (x,y) or (r,z) display
std::vector< int > viewSizeEtaPhi_
display pad xy size for eta/phi view
TAttMarker * clusPatternho_
void DisplayManager::reset ( void  )

Definition at line 2276 of file DisplayManager.cc.

References badBremsId_, blockIdentsMap_, graphicMap_, isGraphicLoaded_, maxERecHitEcal_, maxERecHitHcal_, maxERecHitHo_, AlCaHLTBitMon_ParallelJobs::p, and selectedGObj_.

Referenced by display(), displayEvent(), displayNextInteresting(), and ~DisplayManager().

2277 {
2278  maxERecHitEcal_=-1;
2279  maxERecHitHcal_=-1;
2280  maxERecHitHo_=-1;
2281  isGraphicLoaded_= false;
2282 
2283  std::multimap<int,GPFBase *>::iterator p;
2284  for (p=graphicMap_.begin();p!=graphicMap_.end();p++)
2285  delete p->second;
2286  graphicMap_.clear();
2287 
2288  blockIdentsMap_.clear();
2289  selectedGObj_.clear();
2290  badBremsId_.clear();
2291 
2292 
2293 }
std::multimap< int, GPFBase * > graphicMap_
std::vector< int > selectedGObj_
graphic object containers
std::vector< int > badBremsId_
double maxERecHitEcal_
std::multimap< int, std::pair< int, int > > blockIdentsMap_
double maxERecHitHcal_
void DisplayManager::retrieveBadBrems ( )
private

Definition at line 1667 of file DisplayManager.cc.

References badBremsId_, begin, reco::PFBlockElement::BREM, BREMID, reco::PFBlockElement::ECAL, em_, end, reco::PFBlockElementBrem::GsftrackRefPF(), reco::PFBlockElementBrem::indTrajPoint(), edm::Ref< C, T, F >::key(), reco::PFBlock::LINKTEST_ALL, PFRootEventManager::pfBlocks_, shiftId_, and findQualityFiles::size.

Referenced by loadGGsfRecTracks().

1668 {
1669 
1670  //selects Brems with no information in PFBlock.Those selected Brems are not displayed
1671 
1672  int size = em_->pfBlocks_->size();
1673  for (int ibl=0;ibl<size;ibl++) {
1675  for( iter =((*(em_->pfBlocks_))[ibl].elements()).begin();
1676  iter != ((*(em_->pfBlocks_))[ibl].elements()).end();iter++) {
1677  int ident=-1;
1678  reco::PFBlockElement::Type type = (*iter).type();
1679  if (type == reco::PFBlockElement::BREM) {
1680  std::multimap<double, unsigned> ecalElems;
1681 
1682  (*(em_->pfBlocks_))[ibl].associatedElements( (*iter).index(),(*(em_->pfBlocks_))[ibl].linkData(),
1683  ecalElems ,
1686 
1687 
1688  if (ecalElems.size()==0) {
1689  // std::cout<<" PfBlock Nb "<<ibl<<" -- brem elem "<<(*iter).index()<<"-type "<<(*iter).type()<<" not drawn"<<std::flush<<std::endl;
1690  const reco::PFBlockElementBrem * Brem = dynamic_cast<const reco::PFBlockElementBrem*>(&(*iter));
1691  reco::GsfPFRecTrackRef trackref = Brem->GsftrackRefPF();
1692  unsigned ind=trackref.key()*40+Brem->indTrajPoint();
1693  ident = (BREMID << shiftId_ ) | ind ;
1694  badBremsId_.push_back(ident);
1695  }
1696  }
1697  }
1698  }
1699 }
std::auto_ptr< reco::PFBlockCollection > pfBlocks_
reconstructed pfblocks
type
Definition: HCALResponse.h:22
GsfPFRecTrackRef GsftrackRefPF() const
unsigned int indTrajPoint() const
PFRootEventManager * em_
std::vector< int > badBremsId_
#define end
Definition: vmac.h:38
key_type key() const
Accessor for product key.
Definition: Ref.h:266
#define begin
Definition: vmac.h:31
tuple size
Write out results.
void DisplayManager::rubOutGPFBlock ( )
private

Definition at line 1289 of file DisplayManager.cc.

References create_public_lumi_plots::color, drawGObject(), i, selectedGObj_, and findQualityFiles::size.

Referenced by displayPFBlock(), and findAndDraw().

1290 {
1291  int size = selectedGObj_.size();
1292  bool toInitial=true;
1293  int color=0;
1294  for (int i=0;i<size;i++)
1295  drawGObject(selectedGObj_[i],color,toInitial);
1296 }
void drawGObject(int ident, int color, bool toInitialColor)
int i
Definition: DBlmapReader.cc:9
std::vector< int > selectedGObj_
graphic object containers
tuple size
Write out results.
void DisplayManager::setNewAttrToSimParticles ( )

Definition at line 2306 of file DisplayManager.cc.

References simPartPatternDefault_, simPartPatternElec_, simPartPatternK_, simPartPatternM_, simPartPatternMuon_, simPartPatternNeutron_, simPartPatternPhoton_, simPartPatternPi_, and simPartPatternProton_.

Referenced by readOptions().

2307 {
2308  simPartPatternM_.clear();
2317 }
std::vector< TAttMarker * > simPartPatternM_
TAttMarker * simPartPatternPi_
TAttMarker * simPartPatternProton_
TAttMarker * simPartPatternPhoton_
TAttMarker * simPartPatternElec_
TAttMarker * simPartPatternMuon_
TAttMarker * simPartPatternNeutron_
TAttMarker * simPartPatternK_
TAttMarker * simPartPatternDefault_
void DisplayManager::unZoom ( )

Definition at line 2295 of file DisplayManager.cc.

References displayHist_, i, and updateDisplay().

Referenced by DialogFrame::unZoom().

2296 {
2297  for( unsigned i=0; i<displayHist_.size(); i++) {
2298  // the corresponding view was not requested
2299  if( ! displayHist_[i] ) continue;
2300  displayHist_[i]->GetXaxis()->UnZoom();
2301  displayHist_[i]->GetYaxis()->UnZoom();
2302  }
2303  updateDisplay();
2304 }
int i
Definition: DBlmapReader.cc:9
std::vector< TH2F * > displayHist_
support histogram for x/y or r/z display.
void DisplayManager::updateDisplay ( )

Definition at line 1409 of file DisplayManager.cc.

References displayView_, drawHO_, EHO, i, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by findAndDraw(), findBlock(), unZoom(), and DialogFrame::updateDisplay().

1409  {
1410  for(unsigned i=0; i<displayView_.size(); i++) {
1411  if (!drawHO_ && i==EHO) continue;
1412  TPad* p = displayView_[i];
1413  assert( p );
1414  p->Modified();
1415  p->Update();
1416  }
1417 }
int i
Definition: DBlmapReader.cc:9
std::vector< TCanvas * > displayView_
vector of canvas for x/y or r/z display

Member Data Documentation

std::vector<int> DisplayManager::badBremsId_
private

Definition at line 185 of file DisplayManager.h.

Referenced by findBadBremsId(), reset(), and retrieveBadBrems().

std::multimap<int , std::pair <int,int> > DisplayManager::blockIdentsMap_

Definition at line 95 of file DisplayManager.h.

Referenced by displayPFBlock(), findBlock(), loadGPFBlocks(), and reset().

std::vector<float> DisplayManager::bremAttributes_

Definition at line 100 of file DisplayManager.h.

Referenced by readOptions().

TAttLine* DisplayManager::bremPatternL_

Definition at line 116 of file DisplayManager.h.

Referenced by createGTrack(), and readOptions().

TAttMarker* DisplayManager::bremPatternM_

Definition at line 115 of file DisplayManager.h.

Referenced by createGTrack(), and readOptions().

double DisplayManager::clusEnMin_
TAttMarker* DisplayManager::clusPattern_
TAttMarker* DisplayManager::clusPatternecal_

Definition at line 107 of file DisplayManager.h.

Referenced by createGCluster(), and readOptions().

TAttMarker* DisplayManager::clusPatternhfem_

Definition at line 109 of file DisplayManager.h.

Referenced by createGCluster(), and readOptions().

TAttMarker* DisplayManager::clusPatternho_

Definition at line 108 of file DisplayManager.h.

Referenced by createGCluster(), and readOptions().

TAttMarker* DisplayManager::clusPSPattern_

Definition at line 105 of file DisplayManager.h.

Referenced by createGCluster(), and readOptions().

std::vector<float> DisplayManager::clusterAttributes_

Definition at line 101 of file DisplayManager.h.

Referenced by readOptions().

std::vector<TH2F*> DisplayManager::displayHist_
private

support histogram for x/y or r/z display.

Definition at line 163 of file DisplayManager.h.

Referenced by createCanvas(), displayCanvas(), lookForGenParticle(), lookForMaxRecHit(), and unZoom().

std::vector<TCanvas*> DisplayManager::displayView_
private

vector of canvas for x/y or r/z display

Definition at line 154 of file DisplayManager.h.

Referenced by createCanvas(), displayAll(), displayCanvas(), drawGObject(), lookForGenParticle(), lookForMaxRecHit(), printDisplay(), and updateDisplay().

bool DisplayManager::drawBrems_
bool DisplayManager::drawClus_
bool DisplayManager::drawClusterL_

Definition at line 84 of file DisplayManager.h.

Referenced by readOptions().

bool DisplayManager::drawGenParticles_
bool DisplayManager::drawGsfTracks_
bool DisplayManager::drawHits_
bool DisplayManager::drawHO_
bool DisplayManager::drawParticles_
bool DisplayManager::drawPFBlocks_
bool DisplayManager::drawTracks_
PFRootEventManager* DisplayManager::em_
private
int DisplayManager::eventNumber_
private
TBox DisplayManager::frontFaceECALRZ_
private

ECAL in RZ view.

Definition at line 169 of file DisplayManager.h.

Referenced by createCanvas(), and displayCanvas().

TEllipse DisplayManager::frontFaceECALXY_
private

ECAL in XY view.

Definition at line 166 of file DisplayManager.h.

Referenced by createCanvas(), and displayCanvas().

TEllipse DisplayManager::frontFaceHCALXY_
private

HCAL in XY view.

Definition at line 172 of file DisplayManager.h.

Referenced by createCanvas(), and displayCanvas().

TEllipse DisplayManager::frontFaceHOXY_
private

HO in XY view.

Definition at line 175 of file DisplayManager.h.

Referenced by createCanvas(), and displayCanvas().

double DisplayManager::genParticlePtMin_
TAttMarker* DisplayManager::genPartPattern_

Definition at line 117 of file DisplayManager.h.

Referenced by createGGenParticle(), and readOptions().

std::multimap<int,GPFBase *> DisplayManager::graphicMap_
std::vector<float> DisplayManager::gsfAttributes_

Definition at line 99 of file DisplayManager.h.

Referenced by readOptions().

TAttLine* DisplayManager::gsfPatternL_

Definition at line 114 of file DisplayManager.h.

Referenced by createGTrack(), and readOptions().

TAttMarker* DisplayManager::gsfPatternM_

Definition at line 113 of file DisplayManager.h.

Referenced by createGTrack(), and readOptions().

double DisplayManager::gsfPtMin_
double DisplayManager::hitEnMin_
bool DisplayManager::isGraphicLoaded_
private

Definition at line 142 of file DisplayManager.h.

Referenced by display(), displayAll(), displayEvent(), displayNextInteresting(), and reset().

double DisplayManager::maxERecHitEcal_
private

Definition at line 139 of file DisplayManager.h.

Referenced by getMaxEEcal(), and reset().

double DisplayManager::maxERecHitHcal_
private

Definition at line 140 of file DisplayManager.h.

Referenced by getMaxEHcal(), and reset().

double DisplayManager::maxERecHitHo_
private

Definition at line 141 of file DisplayManager.h.

Referenced by getMaxEHo(), and reset().

int DisplayManager::maxEvents_
private

Definition at line 144 of file DisplayManager.h.

Referenced by display(), and DisplayManager().

IO* DisplayManager::options_
private

options file parser

Definition at line 137 of file DisplayManager.h.

Referenced by valtools.webpage::parseArgs(), and readOptions().

double DisplayManager::particlePtMin_
std::vector<int> DisplayManager::selectedGObj_
private

graphic object containers

Definition at line 184 of file DisplayManager.h.

Referenced by displayPFBlock(), drawGObject(), findAndDraw(), reset(), and rubOutGPFBlock().

int DisplayManager::shiftId_
private

shiftId_ is the number of low bits indicating the object nb in the map key the object type is obtained by shifting the key number of shiftId_ bits ShiftId_ == SHIFTID == 26

Definition at line 150 of file DisplayManager.h.

Referenced by createGGenParticle(), displayAll(), drawWithNewGraphicAttributes(), findAndDraw(), loadGClusters(), loadGGsfRecTracks(), loadGPFBlocks(), loadGRecHits(), loadGRecTracks(), loadGSimParticles(), and retrieveBadBrems().

TAttMarker* DisplayManager::simPartPatternDefault_

Definition at line 127 of file DisplayManager.h.

Referenced by readOptions(), and setNewAttrToSimParticles().

TAttMarker* DisplayManager::simPartPatternElec_

Definition at line 121 of file DisplayManager.h.

Referenced by readOptions(), and setNewAttrToSimParticles().

TAttMarker* DisplayManager::simPartPatternK_

Definition at line 123 of file DisplayManager.h.

Referenced by readOptions(), and setNewAttrToSimParticles().

TAttLine* DisplayManager::simPartPatternL_

Definition at line 119 of file DisplayManager.h.

Referenced by createGPart(), and readOptions().

std::vector<TAttMarker *> DisplayManager::simPartPatternM_

Definition at line 129 of file DisplayManager.h.

Referenced by createGPart(), readOptions(), and setNewAttrToSimParticles().

TAttMarker* DisplayManager::simPartPatternMuon_

Definition at line 122 of file DisplayManager.h.

Referenced by readOptions(), and setNewAttrToSimParticles().

TAttMarker* DisplayManager::simPartPatternNeutron_

Definition at line 126 of file DisplayManager.h.

Referenced by readOptions(), and setNewAttrToSimParticles().

TAttMarker* DisplayManager::simPartPatternPhoton_

Definition at line 120 of file DisplayManager.h.

Referenced by readOptions(), and setNewAttrToSimParticles().

TAttMarker* DisplayManager::simPartPatternPi_

Definition at line 124 of file DisplayManager.h.

Referenced by readOptions(), and setNewAttrToSimParticles().

TAttMarker* DisplayManager::simPartPatternProton_

Definition at line 125 of file DisplayManager.h.

Referenced by readOptions(), and setNewAttrToSimParticles().

std::vector<float> DisplayManager::trackAttributes_

Definition at line 98 of file DisplayManager.h.

Referenced by readOptions().

TAttLine* DisplayManager::trackPatternL_
TAttMarker* DisplayManager::trackPatternM_
double DisplayManager::trackPtMin_
std::vector<int> DisplayManager::viewSize_
private

display pad xy size for (x,y) or (r,z) display

Definition at line 157 of file DisplayManager.h.

Referenced by createCanvas(), and readOptions().

std::vector<int> DisplayManager::viewSizeEtaPhi_
private

display pad xy size for eta/phi view

Definition at line 160 of file DisplayManager.h.

Referenced by readOptions().

double DisplayManager::zoomFactor_
private

Definition at line 145 of file DisplayManager.h.

Referenced by lookForGenParticle(), lookForMaxRecHit(), and readOptions().