CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWSimTrackProxyBuilder Class Reference
Inheritance diagram for FWSimTrackProxyBuilder:
FWProxyBuilderBase

Public Member Functions

 FWSimTrackProxyBuilder (void)
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
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 &)
 
virtual 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 ()
 

Static Public Member Functions

static const std::string & classPurpose ()
 
static const std::string & classRegisterTypeName ()
 
static const std::string & classTypeName ()
 
static const std::string & classView ()
 
- 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...
 

Private Member Functions

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

Additional Inherited Members

- 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 43 of file FWSimTrackProxyBuilder.cc.

Referenced by build().

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

Reimplemented from FWProxyBuilderBase.

Definition at line 199 of file FWSimTrackProxyBuilder.cc.

References addParticlesToPdgDataBase(), CoreSimTrack::charge(), runEdmFileComparison::collection, FWProxyBuilderBase::context(), end, FWEventItem::get(), edm::EventBase::getByLabel(), FWEventItem::getEvent(), fireworks::Context::getTrackPropagator(), i, edm::HandleBase::isValid(), FWProxyBuilderBase::item(), CoreSimTrack::momentum(), SimTrack::noVertex(), LargeD0_PixelPairStep_cff::propagator, FWProxyBuilderBase::setupAddElement(), SimTrack::trackerSurfaceMomentum(), SimTrack::trackerSurfacePosition(), CoreSimTrack::type(), and SimTrack::vertIndex().

200 {
202  iItem->get( collection );
203 
204  if( 0 == collection )
205  {
206  return;
207  }
209 
210  TEveTrackPropagator* propagator = context().getTrackPropagator();
211 
212 
214  const edm::EventBase *event = item()->getEvent();
215  event->getByLabel( edm::InputTag( "g4SimHits" ), hitColl );
216 
217  int i = 0;
218  for( std::vector<SimTrack>::const_iterator it = collection->begin(), end = collection->end(); it != end; ++it )
219  {
220  const SimTrack& iData = (*it);
221  double vx = 0.0;
222  double vy = 0.0;
223  double vz = 0.0;
224  double vt = 0.0;
225  if(! iData.noVertex() && ( hitColl.isValid() && !hitColl->empty()))
226  {
227  int vInd = iData.vertIndex();
228  vx = hitColl->at(vInd).position().x();
229  vy = hitColl->at(vInd).position().y();
230  vz = hitColl->at(vInd).position().z();
231  vt = hitColl->at(vInd).position().t();
232  }
233 
234  TParticle* particle = new TParticle;
235  particle->SetPdgCode( iData.type());
236  particle->SetMomentum( iData.momentum().px(), iData.momentum().py(), iData.momentum().pz(), iData.momentum().e());
237  particle->SetProductionVertex( vx, vy, vz, vt );
238 
239  TEveTrack* track = new TEveTrack( particle, ++i, propagator );
240  if( iData.charge() == 0 )
241  {
242  track->SetLineStyle( 7 );
243  }
244  track->AddPathMark( TEvePathMark( TEvePathMark::kReference,
245  TEveVector( iData.trackerSurfacePosition().x(), iData.trackerSurfacePosition().y(), iData.trackerSurfacePosition().z()),
246  TEveVector( iData.trackerSurfaceMomentum().px(), iData.trackerSurfaceMomentum().py(), iData.trackerSurfaceMomentum().pz())));
247  track->MakeTrack();
248  setupAddElement( track, product );
249  }
250 }
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:85
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:74
float charge() const
charge
Definition: CoreSimTrack.cc:3
const FWEventItem * item() const
bool noVertex() const
Definition: SimTrack.h:30
#define end
Definition: vmac.h:38
bool isValid() const
Definition: HandleBase.h:76
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
Definition: SimTrack.h:29
const edm::EventBase * getEvent() const
Definition: FWEventItem.h:147
const math::XYZTLorentzVectorD & trackerSurfaceMomentum() const
Definition: SimTrack.h:38
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:40
bool getByLabel(InputTag const &, Handle< T > &) const
Definition: EventBase.h:86
const math::XYZTLorentzVectorD & momentum() const
particle info...
Definition: CoreSimTrack.h:36
std::vector< SimTrack > SimTrackContainer
const std::string & FWSimTrackProxyBuilder::classPurpose ( )
static

Definition at line 252 of file FWSimTrackProxyBuilder.cc.

const std::string & FWSimTrackProxyBuilder::classRegisterTypeName ( )
static

Definition at line 252 of file FWSimTrackProxyBuilder.cc.

const std::string & FWSimTrackProxyBuilder::classTypeName ( )
static

Definition at line 252 of file FWSimTrackProxyBuilder.cc.

const std::string & FWSimTrackProxyBuilder::classView ( )
static

Definition at line 252 of file FWSimTrackProxyBuilder.cc.

const FWSimTrackProxyBuilder& FWSimTrackProxyBuilder::operator= ( const FWSimTrackProxyBuilder )
private
const std::string& FWSimTrackProxyBuilder::purpose ( ) const
inline

Definition at line 29 of file FWSimTrackProxyBuilder.cc.

31 :
32  // Disable default copy constructor
const std::string& FWSimTrackProxyBuilder::typeName ( ) const
inline

Definition at line 29 of file FWSimTrackProxyBuilder.cc.

31 :
32  // Disable default copy constructor
const std::string& FWSimTrackProxyBuilder::view ( ) const
inline

Definition at line 29 of file FWSimTrackProxyBuilder.cc.

31 :
32  // Disable default copy constructor