CMS 3D CMS Logo

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

#include <FWBoxRecHit.h>

Public Member Functions

void addLine (float x1, float y1, float z1, float x2, float y2, float z2)
 
void addLine (const TEveVector &v1, const TEveVector &v2)
 
 FWBoxRecHit (const std::vector< TEveVector > &corners, TEveElement *comp, float e, float et)
 
float getEnergy (bool b) const
 
TEveBox * getTower ()
 
bool isTallest () const
 
void setIsTallest ()
 
void setLine (int idx, float x1, float y1, float z1, float x2, float y2, float z2)
 
void setSquareColor (Color_t c)
 
void updateScale (float scale, float maxLogVal, bool plotEt)
 
virtual ~FWBoxRecHit ()
 

Private Member Functions

void buildLineSet (const std::vector< TEveVector > &corners)
 
void buildTower (const std::vector< TEveVector > &corners)
 
 FWBoxRecHit (const FWBoxRecHit &)
 
const FWBoxRecHitoperator= (const FWBoxRecHit &)
 
void setupEveBox (std::vector< TEveVector > &corners, float scale)
 

Private Attributes

float m_energy
 
float m_et
 
bool m_isTallest
 
TEveStraightLineSet * m_ls
 
TEveBox * m_tower
 

Detailed Description

Definition at line 34 of file FWBoxRecHit.h.

Constructor & Destructor Documentation

FWBoxRecHit::FWBoxRecHit ( const std::vector< TEveVector > &  corners,
TEveElement *  comp,
float  e,
float  et 
)

Definition at line 10 of file FWBoxRecHit.cc.

References buildLineSet(), buildTower(), h, m_ls, and m_tower.

10  :
11  m_tower(0), m_ls(0), m_energy(e), m_et(et), m_isTallest(false)
12 {
13  buildTower( corners);
14  buildLineSet( corners);
15 
16  TEveCompound* h = new TEveCompound("rechit box", "tower");
17  list->AddElement(h);
18  h->CSCApplyMainColorToAllChildren();
19  h->AddElement( m_tower);
20  h->AddElement( m_ls );
21 }
float m_energy
Definition: FWBoxRecHit.h:65
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
void buildTower(const std::vector< TEveVector > &corners)
Definition: FWBoxRecHit.cc:53
TEveStraightLineSet * m_ls
Definition: FWBoxRecHit.h:64
void buildLineSet(const std::vector< TEveVector > &corners)
Definition: FWBoxRecHit.cc:70
TEveBox * m_tower
Definition: FWBoxRecHit.h:63
bool m_isTallest
Definition: FWBoxRecHit.h:67
float m_et
Definition: FWBoxRecHit.h:66
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 list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
virtual FWBoxRecHit::~FWBoxRecHit ( )
inlinevirtual

Definition at line 39 of file FWBoxRecHit.h.

39 {}
FWBoxRecHit::FWBoxRecHit ( const FWBoxRecHit )
private

Member Function Documentation

void FWBoxRecHit::addLine ( float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
)

Definition at line 179 of file FWBoxRecHit.cc.

References m_ls.

180 {
181  m_ls->AddLine( x1, y1, z1, x2, y2, z2 );
182 }
TEveStraightLineSet * m_ls
Definition: FWBoxRecHit.h:64
void FWBoxRecHit::addLine ( const TEveVector &  v1,
const TEveVector &  v2 
)

Definition at line 186 of file FWBoxRecHit.cc.

References m_ls.

187 {
188  m_ls->AddLine(v1.fX, v1.fY, v1.fZ, v2.fX, v2.fY, v2.fZ);
189 }
TEveStraightLineSet * m_ls
Definition: FWBoxRecHit.h:64
void FWBoxRecHit::buildLineSet ( const std::vector< TEveVector > &  corners)
private

Definition at line 70 of file FWBoxRecHit.cc.

References EnergyCorrector::c, data, i, m_ls, and m_tower.

Referenced by FWBoxRecHit().

71 {
72  m_ls = new TEveStraightLineSet( "EcalRecHitLineSet" );
73 
74 
75  const float *data;
76  TEveVector c;
77  for( unsigned int i = 0; i < 4; ++i )
78  {
79  data = m_tower->GetVertex( i );
80  c.fX += data[0];
81  c.fY += data[1];
82  m_ls->AddLine( data[0], data[1], 0, data[0], data[1], 0);
83 
84  }
85  c *= 0.25;
86 
87 
88  // last line is trick to add a marker in line set
89  m_ls->SetMarkerStyle( 1 );
90  m_ls->AddLine( c.fX, c.fY, c.fZ, c.fX, c.fY, c.fZ );
91  m_ls->AddMarker( 0, 0. );
92 
93 
94  m_ls->ResetBBox();
95  m_ls->ComputeBBox();
96 }
int i
Definition: DBlmapReader.cc:9
TEveStraightLineSet * m_ls
Definition: FWBoxRecHit.h:64
TEveBox * m_tower
Definition: FWBoxRecHit.h:63
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void FWBoxRecHit::buildTower ( const std::vector< TEveVector > &  corners)
private

Definition at line 53 of file FWBoxRecHit.cc.

References f, m_tower, and setupEveBox().

Referenced by FWBoxRecHit().

54 {
55  m_tower = new TEveBox( "EcalRecHitTower" );
56  std::vector<TEveVector> towerCorners = corners;
57  /*
58  FWViewEnergyScale *caloScale = 1;//getEnergyScale();
59  float val = caloScale->getPlotEt() ? m_et : m_energy;
60  float scale = caloScale->getScaleFactorLego() * val;
61 
62  if( scale < 0 )
63  scale *= -1;
64  */
65  setupEveBox( towerCorners, 0.01f );
66 }
void setupEveBox(std::vector< TEveVector > &corners, float scale)
Definition: FWBoxRecHit.cc:34
double f[11][100]
TEveBox * m_tower
Definition: FWBoxRecHit.h:63
float FWBoxRecHit::getEnergy ( bool  b) const
inline

Definition at line 49 of file FWBoxRecHit.h.

References m_energy, and m_et.

49 { return b ? m_et : m_energy; }
float m_energy
Definition: FWBoxRecHit.h:65
float m_et
Definition: FWBoxRecHit.h:66
double b
Definition: hdecay.h:120
TEveBox* FWBoxRecHit::getTower ( )
inline

Definition at line 45 of file FWBoxRecHit.h.

References m_tower.

45 { return m_tower; }
TEveBox * m_tower
Definition: FWBoxRecHit.h:63
bool FWBoxRecHit::isTallest ( ) const
inline

Definition at line 50 of file FWBoxRecHit.h.

References m_isTallest.

50 { return m_isTallest; }
bool m_isTallest
Definition: FWBoxRecHit.h:67
const FWBoxRecHit& FWBoxRecHit::operator= ( const FWBoxRecHit )
private
void FWBoxRecHit::setIsTallest ( )

Definition at line 170 of file FWBoxRecHit.cc.

References m_isTallest.

171 {
172  m_isTallest = true;
173 
174 
175 }
bool m_isTallest
Definition: FWBoxRecHit.h:67
void FWBoxRecHit::setLine ( int  idx,
float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
)

Definition at line 153 of file FWBoxRecHit.cc.

References cmsLHEtoEOSManager::l, and m_ls.

Referenced by updateScale().

154 {
155  // AMT: this func should go in TEveStraightLineSet class
156 
157  TEveStraightLineSet::Line_t* l = ((TEveStraightLineSet::Line_t*)(m_ls->GetLinePlex().Atom(idx)));
158 
159  l->fV1[0] = x1;
160  l->fV1[1] = y1;
161  l->fV1[2] = z1;
162 
163  l->fV2[0] = x2;
164  l->fV2[1] = y2;
165  l->fV2[2] = z2;
166 }
TEveStraightLineSet * m_ls
Definition: FWBoxRecHit.h:64
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void FWBoxRecHit::setSquareColor ( Color_t  c)
inline

Definition at line 43 of file FWBoxRecHit.h.

References m_ls.

43 { m_ls->SetMarkerColor(c); m_ls->SetLineColor(kBlack); }
TEveStraightLineSet * m_ls
Definition: FWBoxRecHit.h:64
void FWBoxRecHit::setupEveBox ( std::vector< TEveVector > &  corners,
float  scale 
)
private

Definition at line 34 of file FWBoxRecHit.cc.

References i, j, m_tower, and pileupReCalc_HLTpaths::scale.

Referenced by buildTower().

35 {
36  // printf("---\n");
37  // TEveVector z(0.f, 0.f, 0.f);
38  for( size_t i = 0; i < 4; ++i)
39  {
40  int j = i + 4;
41  corners[i+4].fZ = scale;
42  m_tower->SetVertex( i, corners[i] );
43  m_tower->SetVertex( j, corners[j] );
44  // printf("%ld -> %f, %f , height=%f \n",i, corners[i].fX, corners[i].fY, scale);
45  }
46 
47  m_tower->SetLineWidth( 1.0 );
48  m_tower->SetLineColor( kBlack );
49 }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
TEveBox * m_tower
Definition: FWBoxRecHit.h:63
void FWBoxRecHit::updateScale ( float  scale,
float  maxLogVal,
bool  plotEt 
)

Definition at line 100 of file FWBoxRecHit.cc.

References EnergyCorrector::c, ztail::d, data, i, dqm-mbProfile::log, visualization-live-secondInstance_cfg::m, m_energy, m_et, m_isTallest, m_ls, m_tower, alignCSCRings::s, pileupReCalc_HLTpaths::scale, setLine(), and z.

101 {
102  // FWViewEnergyScale *caloScale = getEnergyScale();
103  //
104  //float scale = caloScale->getScaleFactorLego() * val;
105 
106  // printf("scale %f %f\n", caloScale->getValToHeight(), val);
107 float val = plotEt ? m_et : m_energy;
108  float scale = scaleFac * val;
109  // Reposition top points of tower
110  const float *data;
111  TEveVector c;
112  for( unsigned int i = 0; i < 4; ++i )
113  {
114  data = m_tower->GetVertex( i );
115  c.fX += data[0];
116  c.fY += data[1];
117  m_tower->SetVertex( i, data[0], data[1], 0 );
118  m_tower->SetVertex( i+4, data[0], data[1], scale);
119  }
120  c *= 0.25;
121  if (0) c.Dump();
122 
123  // Scale lineset
124  float s = log( 1 + val ) / maxLogVal;
125  float d = 0.5 * ( m_tower->GetVertex(1)[0] -m_tower->GetVertex(0)[0]);
126  d *= s;
127  float z = scale * 1.001;
128  setLine(0, c.fX - d, c.fY -d, z, c.fX + d, c.fY -d, z);
129  setLine(1, c.fX + d, c.fY -d, z, c.fX + d, c.fY +d, z);
130  setLine(2, c.fX + d, c.fY +d, z, c.fX - d, c.fY +d, z);
131  setLine(3, c.fX - d, c.fY +d, z, c.fX - d, c.fY -d, z);
132 
133  if( m_isTallest )
134  {
135 
136  m_ls->AddLine( c.fX - d, c.fY - d, z, c.fX + d, c.fY + d, z );
137  m_ls->AddLine( c.fX - d, c.fY + d, z, c.fX + d, c.fY - d, z );
138  m_ls->GetMarkerPlex().Refit();
139  }
140 
141  TEveStraightLineSet::Marker_t* m = ((TEveStraightLineSet::Marker_t*)(m_ls->GetMarkerPlex().Atom(0)));
142  m->fV[0] = c.fX; m->fV[1] = c.fY; m->fV[2] = z;
143 
144  // stamp changed elements
145 
146  m_ls->ComputeBBox();
147  // float* bb = m_ls->GetBBox();
148  m_tower->StampTransBBox();
149  m_ls->StampTransBBox();
150 }
int i
Definition: DBlmapReader.cc:9
float m_energy
Definition: FWBoxRecHit.h:65
TEveStraightLineSet * m_ls
Definition: FWBoxRecHit.h:64
tuple d
Definition: ztail.py:151
TEveBox * m_tower
Definition: FWBoxRecHit.h:63
bool m_isTallest
Definition: FWBoxRecHit.h:67
float m_et
Definition: FWBoxRecHit.h:66
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void setLine(int idx, float x1, float y1, float z1, float x2, float y2, float z2)
Definition: FWBoxRecHit.cc:153

Member Data Documentation

float FWBoxRecHit::m_energy
private

Definition at line 65 of file FWBoxRecHit.h.

Referenced by getEnergy(), and updateScale().

float FWBoxRecHit::m_et
private

Definition at line 66 of file FWBoxRecHit.h.

Referenced by getEnergy(), and updateScale().

bool FWBoxRecHit::m_isTallest
private

Definition at line 67 of file FWBoxRecHit.h.

Referenced by isTallest(), setIsTallest(), and updateScale().

TEveStraightLineSet* FWBoxRecHit::m_ls
private

Definition at line 64 of file FWBoxRecHit.h.

Referenced by addLine(), buildLineSet(), FWBoxRecHit(), setLine(), setSquareColor(), and updateScale().

TEveBox* FWBoxRecHit::m_tower
private

Definition at line 63 of file FWBoxRecHit.h.

Referenced by buildLineSet(), buildTower(), FWBoxRecHit(), getTower(), setupEveBox(), and updateScale().