CMS 3D CMS Logo

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(), m_ls, and m_tower.

Referenced by isTallest().

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
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
et
define resolution functions of each parameter
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.

References Scenarios_cff::scale, and updateScale().

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.

Referenced by getTower().

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(), and isTallest().

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(), and isTallest().

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 addLine(), training_settings::idx, m_tower, and setLine().

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 buildLineSet(), buildTower(), FWBoxRecHit(), m_isTallest, operator=(), setIsTallest(), and setupEveBox().

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

Referenced by isTallest().

void FWBoxRecHit::setIsTallest ( )

Definition at line 170 of file FWBoxRecHit.cc.

References m_isTallest.

Referenced by 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 checklumidiff::l, and m_ls.

Referenced by getTower(), and 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
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 Scenarios_cff::scale.

Referenced by buildTower(), and isTallest().

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, edmIntegrityCheck::d, data, i, cmsBatch::log, funct::m, m_energy, m_et, m_isTallest, m_ls, m_tower, alignCSCRings::s, Scenarios_cff::scale, setLine(), heppy_batch::val, and z.

Referenced by ~FWBoxRecHit().

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
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().