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
FWSimTrackProxyBuilder Class Reference
Inheritance diagram for FWSimTrackProxyBuilder:
FWProxyBuilderBase

Public Member Functions

 FWSimTrackProxyBuilder (void)
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual ~FWSimTrackProxyBuilder (void)
 
- Public Member Functions inherited from FWProxyBuilderBase
void build ()
 
virtual bool canHandle (const FWEventItem &)
 
const fireworks::Contextcontext () const
 
TEveElementList * createProduct (FWViewType::EType, const FWViewContext *)
 
 FWProxyBuilderBase ()
 
bool getHaveWindow () const
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () const
 
const FWEventItemitem () const
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
void itemChanged (const FWEventItem *)
 
int layer () const
 
void modelChanges (const FWModelIds &)
 
void removePerViewProduct (FWViewType::EType, const FWViewContext *vc)
 
void scaleChanged (const FWViewContext *)
 
void setHaveWindow (bool iFlag)
 
virtual void setInteractionList (FWInteractionList *, const std::string &)
 
void setItem (const FWEventItem *iItem)
 
void setupAddElement (TEveElement *el, TEveElement *parent, bool set_color=true) const
 
void setupElement (TEveElement *el, bool color=true) const
 
virtual bool willHandleInteraction () const
 
virtual ~FWProxyBuilderBase ()
 

Private Member Functions

void addParticlesToPdgDataBase (void)
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
 FWSimTrackProxyBuilder (const FWSimTrackProxyBuilder &)
 
void getVertices (void)
 
const FWSimTrackProxyBuilderoperator= (const FWSimTrackProxyBuilder &)
 

Private Attributes

std::vector< SimVertexm_vertices
 

Additional Inherited Members

- Static Public Member Functions inherited from FWProxyBuilderBase
static bool representsSubPart ()
 
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
virtual void clean ()
 
virtual void cleanLocal ()
 
TEveCompound * createCompound (bool set_color=true, bool propagate_color_to_all_children=false) const
 
 FWProxyBuilderBase (const FWProxyBuilderBase &)
 
void increaseComponentTransparency (unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 23 of file FWSimTrackProxyBuilder.cc.

Constructor & Destructor Documentation

FWSimTrackProxyBuilder::FWSimTrackProxyBuilder ( void  )
inline

Definition at line 26 of file FWSimTrackProxyBuilder.cc.

26 {}
virtual FWSimTrackProxyBuilder::~FWSimTrackProxyBuilder ( void  )
inlinevirtual

Definition at line 27 of file FWSimTrackProxyBuilder.cc.

27 {}
FWSimTrackProxyBuilder::FWSimTrackProxyBuilder ( const FWSimTrackProxyBuilder )
private

Member Function Documentation

void FWSimTrackProxyBuilder::addParticlesToPdgDataBase ( void  )
private

Definition at line 62 of file FWSimTrackProxyBuilder.cc.

Referenced by build().

63 {
64  static Bool_t bAdded = kFALSE;
65  // Check if already called
66  if(bAdded)return;
67  bAdded = true;
68 
69  TDatabasePDG *pdgDB = TDatabasePDG::Instance();
70  const Int_t kspe=50000000;
71 
72  // PDG nuclear states are 10-digit numbers
73  // 10LZZZAAAI e.g. deuteron is
74  // 1000010020
75  const Int_t kion=1000000000;
76 
77  /*
78  const Double_t kAu2Gev=0.9314943228;
79  */
80 
81  const Double_t khSlash = 1.0545726663e-27;
82  const Double_t kErg2Gev = 1/1.6021773349e-3;
83  const Double_t khShGev = khSlash*kErg2Gev;
84  const Double_t kYear2Sec = 3600*24*365.25;
85 
86  //
87  // Bottom mesons
88  // mass and life-time from PDG
89  //
90  pdgDB->AddParticle("Upsilon(3S)","Upsilon(3S)",10.3552,kTRUE,
91  0,1,"Bottonium",200553);
92 
93  // QCD diffractive states
94  pdgDB->AddParticle("rho_diff0","rho_diff0",0,kTRUE,
95  0,0,"QCD diffr. state",9900110);
96  pdgDB->AddParticle("pi_diffr+","pi_diffr+",0,kTRUE,
97  0,1,"QCD diffr. state",9900210);
98  pdgDB->AddParticle("omega_di","omega_di",0,kTRUE,
99  0,0,"QCD diffr. state",9900220);
100  pdgDB->AddParticle("phi_diff","phi_diff",0,kTRUE,
101  0,0,"QCD diffr. state",9900330);
102  pdgDB->AddParticle("J/psi_di","J/psi_di",0,kTRUE,
103  0,0,"QCD diffr. state",9900440);
104  pdgDB->AddParticle("n_diffr0","n_diffr0",0,kTRUE,
105  0,0,"QCD diffr. state",9902110);
106  pdgDB->AddParticle("p_diffr+","p_diffr+",0,kTRUE,
107  0,1,"QCD diffr. state",9902210);
108 
109  // From Herwig
110  pdgDB->AddParticle("PSID ", " ", 3.7699, kFALSE, 0.0, 0, "meson", 30443);
111 
112  pdgDB->AddParticle("A_00 ", " ", 0.9960, kFALSE, 0.0, 0, "meson", 9000111);
113  pdgDB->AddParticle("A_0+ ", " ", 0.9960, kFALSE, 0.0,+3, "meson", 9000211);
114  pdgDB->AddParticle("A_0- ", " ", 0.9960, kFALSE, 0.0,-3, "meson", -9000211);
115 
116  pdgDB->AddParticle("F0P0 ", " ", 0.9960, kFALSE, 0.0, 0, "meson", 9010221);
117 
118  pdgDB->AddParticle("KDL_2+ ", " ", 1.773, kFALSE, 0.0,+3, "meson", 10325);
119  pdgDB->AddParticle("KDL_2- ", " ", 1.773, kFALSE, 0.0,-3, "meson", -10325);
120 
121  pdgDB->AddParticle("KDL_20 ", " ", 1.773, kFALSE, 0.0, 0, "meson", 10315);
122  pdgDB->AddParticle("KDL_2BR0", " ", 1.773, kFALSE, 0.0, 0, "meson", -10315);
123 
124  pdgDB->AddParticle("PI_2+ ", " ", 1.670, kFALSE, 0.0,+3, "meson", 10215);
125  pdgDB->AddParticle("PI_2- ", " ", 1.670, kFALSE, 0.0,-3, "meson", -10215);
126  pdgDB->AddParticle("PI_20 ", " ", 1.670, kFALSE, 0.0, 0, "meson", 10115);
127 
128 
129  pdgDB->AddParticle("KD*+ ", " ", 1.717, kFALSE, 0.0,+3, "meson", 30323);
130  pdgDB->AddParticle("KD*- ", " ", 1.717, kFALSE, 0.0,-3, "meson", -30323);
131 
132  pdgDB->AddParticle("KD*0 ", " ", 1.717, kFALSE, 0.0, 0, "meson", 30313);
133  pdgDB->AddParticle("KDBR*0 ", " ", 1.717, kFALSE, 0.0, 0, "meson", -30313);
134 
135  pdgDB->AddParticle("RHOD+ ", " ", 1.700, kFALSE, 0.0,+3, "meson", 30213);
136  pdgDB->AddParticle("RHOD- ", " ", 1.700, kFALSE, 0.0,-3, "meson", -30213);
137  pdgDB->AddParticle("RHOD0 ", " ", 1.700, kFALSE, 0.0, 0, "meson", 30113);
138 
139  pdgDB->AddParticle("ETA_2(L)", " ", 1.632, kFALSE, 0.0, 0, "meson", 10225);
140  pdgDB->AddParticle("ETA_2(H)", " ", 1.854, kFALSE, 0.0, 0, "meson", 10335);
141  pdgDB->AddParticle("OMEGA(H)", " ", 1.649, kFALSE, 0.0, 0, "meson", 30223);
142 
143 
144  pdgDB->AddParticle("KDH_2+ ", " ", 1.816, kFALSE, 0.0,+3, "meson", 20325);
145  pdgDB->AddParticle("KDH_2- ", " ", 1.816, kFALSE, 0.0,-3, "meson", -20325);
146 
147  pdgDB->AddParticle("KDH_20 ", " ", 1.816, kFALSE, 0.0, 0, "meson", 20315);
148  pdgDB->AddParticle("KDH_2BR0", " ", 1.816, kFALSE, 0.0, 0, "meson", -20315);
149 
150 
151  pdgDB->AddParticle("KD_3+ ", " ", 1.773, kFALSE, 0.0,+3, "meson", 327);
152  pdgDB->AddParticle("KD_3- ", " ", 1.773, kFALSE, 0.0,-3, "meson", -327);
153 
154  pdgDB->AddParticle("KD_30 ", " ", 1.773, kFALSE, 0.0, 0, "meson", 317);
155  pdgDB->AddParticle("KD_3BR0 ", " ", 1.773, kFALSE, 0.0, 0, "meson", -317);
156 
157  pdgDB->AddParticle("RHO_3+ ", " ", 1.691, kFALSE, 0.0,+3, "meson", 217);
158  pdgDB->AddParticle("RHO_3- ", " ", 1.691, kFALSE, 0.0,-3, "meson", -217);
159  pdgDB->AddParticle("RHO_30 ", " ", 1.691, kFALSE, 0.0, 0, "meson", 117);
160  pdgDB->AddParticle("OMEGA_3 ", " ", 1.667, kFALSE, 0.0, 0, "meson", 227);
161  pdgDB->AddParticle("PHI_3 ", " ", 1.854, kFALSE, 0.0, 0, "meson", 337);
162 
163  pdgDB->AddParticle("CHI2P_B0", " ", 10.232, kFALSE, 0.0, 0, "meson", 110551);
164  pdgDB->AddParticle("CHI2P_B1", " ", 10.255, kFALSE, 0.0, 0, "meson", 120553);
165  pdgDB->AddParticle("CHI2P_B2", " ", 10.269, kFALSE, 0.0, 0, "meson", 100555);
166  pdgDB->AddParticle("UPSLON4S", " ", 10.580, kFALSE, 0.0, 0, "meson", 300553);
167 
168 
169  // IONS
170  //
171  // Done by default now from Pythia6 table
172  // Needed for other generators
173  // So check if already defined
174 
175 
176  Int_t ionCode = kion+10020;
177  if(!pdgDB->GetParticle(ionCode)){
178  pdgDB->AddParticle("Deuteron","Deuteron", 1.875613, kTRUE,
179  0,3,"Ion",ionCode);
180  }
181  pdgDB->AddAntiParticle("AntiDeuteron", - ionCode);
182 
183  ionCode = kion+10030;
184  if(!pdgDB->GetParticle(ionCode)){
185  pdgDB->AddParticle("Triton","Triton", 2.80925, kFALSE,
186  khShGev/(12.33*kYear2Sec),3,"Ion",ionCode);
187  }
188  pdgDB->AddAntiParticle("AntiTriton", - ionCode);
189 
190  ionCode = kion+20030;
191  if(!pdgDB->GetParticle(ionCode)){
192  pdgDB->AddParticle("HE3","HE3", 2.80923,kFALSE,
193  0,6,"Ion",ionCode);
194  }
195  pdgDB->AddAntiParticle("AntiHE3", - ionCode);
196 
197  ionCode = kion+20040;
198  if(!pdgDB->GetParticle(ionCode)){
199  pdgDB->AddParticle("Alpha","Alpha", 3.727417, kTRUE,
200  khShGev/(12.33*kYear2Sec), 6, "Ion", ionCode);
201  }
202  pdgDB->AddAntiParticle("AntiAlpha", - ionCode);
203 
204  // Special particles
205  //
206  pdgDB->AddParticle("Cherenkov","Cherenkov",0,kFALSE,
207  0,0,"Special",kspe+50);
208  pdgDB->AddParticle("FeedbackPhoton","FeedbackPhoton",0,kFALSE,
209  0,0,"Special",kspe+51);
210  pdgDB->AddParticle("Lambda1520","Lambda1520",1.5195,kFALSE,
211  0.0156,0,"Resonance",3124);
212  pdgDB->AddAntiParticle("Lambda1520bar",-3124);
213 }
void FWSimTrackProxyBuilder::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext  
)
privatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 216 of file FWSimTrackProxyBuilder.cc.

References addParticlesToPdgDataBase(), CoreSimTrack::charge(), runEdmFileComparison::collection, FWProxyBuilderBase::context(), end, FWEventItem::get(), fireworks::Context::getTrackPropagator(), getVertices(), i, m_vertices, CoreSimTrack::momentum(), SimTrack::noVertex(), position, LargeD0_PixelPairStep_cff::propagator, FWProxyBuilderBase::setupAddElement(), ExpressReco_HICollisions_FallBack::track, SimTrack::trackerSurfaceMomentum(), SimTrack::trackerSurfacePosition(), CoreSimTrack::type(), and SimTrack::vertIndex().

217 {
219  iItem->get( collection );
220 
221  if( 0 == collection )
222  {
223  return;
224  }
226 
227  TEveTrackPropagator* propagator = context().getTrackPropagator();
228  getVertices();
229  int i = 0;
230  for( std::vector<SimTrack>::const_iterator it = collection->begin(), end = collection->end(); it != end; ++it )
231  {
232  const SimTrack& iData = (*it);
233  double vx = 0.0;
234  double vy = 0.0;
235  double vz = 0.0;
236  double vt = 0.0;
237  if(! iData.noVertex() && ! m_vertices.empty())
238  {
239  int vInd = iData.vertIndex();
240  vx = ( m_vertices.at( vInd )).position().x() * 0.01;
241  vy = ( m_vertices.at( vInd )).position().y() * 0.01;
242  vz = ( m_vertices.at( vInd )).position().z() * 0.01;
243  vt = ( m_vertices.at( vInd )).position().t();
244  }
245 
246  TParticle* particle = new TParticle;
247  particle->SetPdgCode( iData.type());
248  particle->SetMomentum( iData.momentum().px(), iData.momentum().py(), iData.momentum().pz(), iData.momentum().e());
249  particle->SetProductionVertex( vx, vy, vz, vt );
250 
251  TEveTrack* track = new TEveTrack( particle, ++i, propagator );
252  if( iData.charge() == 0 )
253  {
254  track->SetLineStyle( 7 );
255  }
256  track->AddPathMark( TEvePathMark( TEvePathMark::kReference,
257  TEveVector( iData.trackerSurfacePosition().x(), iData.trackerSurfacePosition().y(), iData.trackerSurfacePosition().z()),
258  TEveVector( iData.trackerSurfaceMomentum().px(), iData.trackerSurfaceMomentum().py(), iData.trackerSurfaceMomentum().pz())));
259  track->MakeTrack();
260  setupAddElement( track, product );
261  }
262 }
const math::XYZVectorD & trackerSurfacePosition() const
Definition: SimTrack.h:36
const fireworks::Context & context() const
int i
Definition: DBlmapReader.cc:9
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void get(const T *&oData) const
Definition: FWEventItem.h:84
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:74
float charge() const
charge
Definition: CoreSimTrack.cc:3
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
bool noVertex() const
Definition: SimTrack.h:30
#define end
Definition: vmac.h:38
std::vector< SimVertex > m_vertices
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
Definition: SimTrack.h:29
const math::XYZTLorentzVectorD & trackerSurfaceMomentum() const
Definition: SimTrack.h:38
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:40
const math::XYZTLorentzVectorD & momentum() const
particle info...
Definition: CoreSimTrack.h:36
std::vector< SimTrack > SimTrackContainer
void FWSimTrackProxyBuilder::getVertices ( void  )
private

Definition at line 45 of file FWSimTrackProxyBuilder.cc.

References runEdmFileComparison::collection, edm::EventBase::getByLabel(), FWEventItem::getEvent(), edm::HandleBase::isValid(), FWProxyBuilderBase::item(), and m_vertices.

Referenced by build().

46 {
48  const edm::EventBase *event = item()->getEvent();
49  event->getByLabel( edm::InputTag( "g4SimHits" ), collection );
50 
51  if( collection.isValid())
52  {
53  for( std::vector<SimVertex>::const_iterator isimv = collection->begin(), isimvEnd = collection->end();
54  isimv != isimvEnd; ++isimv )
55  {
56  m_vertices.push_back( *isimv );
57  }
58  }
59 }
const FWEventItem * item() const
bool getByLabel(const InputTag &, Handle< T > &) const
Definition: EventBase.h:85
std::vector< SimVertex > m_vertices
bool isValid() const
Definition: HandleBase.h:76
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:146
const FWSimTrackProxyBuilder& FWSimTrackProxyBuilder::operator= ( const FWSimTrackProxyBuilder )
private
FWSimTrackProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )

Member Data Documentation

std::vector<SimVertex> FWSimTrackProxyBuilder::m_vertices
private

Definition at line 41 of file FWSimTrackProxyBuilder.cc.

Referenced by build(), and getVertices().