7 #include "TClonesArray.h"
8 #include "TGeoMCGeometry.h"
9 #include "TGeoManager.h"
10 #include "TLorentzVector.h"
11 #include "TParticle.h"
12 #include "TVirtualMC.h"
14 #include "FairGeoInterface.h"
15 #include "FairGeoLoader.h"
16 #include "FairGeoNode.h"
18 #include "FairGeoRootBuilder.h"
22 #include "FairRootManager.h"
23 #include "FairVolume.h"
26 #include "FairRuntimeDb.h"
28 #include "TObjArray.h"
52 : FairDetector(name, active) {
86 FairRun*
sim = FairRun::Instance();
87 FairRuntimeDb*
rtdb=sim->GetRuntimeDb();
108 Int_t pdgCode = gMC->TrackPid();
110 fmass = gMC->TrackMass();
112 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
114 gMC->CurrentVolID(copyNo);
117 if ( gMC->IsTrackEntering() ) {
120 gMC->TrackPosition(
fPosIn);
121 gMC->TrackMomentum(
fMomIn);
128 if ( gMC->IsTrackExiting() ||
129 gMC->IsTrackStop() ||
130 gMC->IsTrackDisappeared() ) {
136 fTime = gMC->TrackTime() * 1e9;
145 if(vol->getMCid()==8){
154 }
else if(vol->getMCid() ==3){
165 else if(fmuch == kFALSE)
168 if(vol->getMCid()==3){
178 else if(vol->getMCid() ==4){
188 else if(vol->getMCid() == 2){
211 if (fVerboseLevel)
Print();
275 FairRootManager::Instance()->Register(
"Plane1Point",
"Plane1",
fPlane1Collection, kTRUE);
276 FairRootManager::Instance()->Register(
"Plane2Point",
"Plane2",
fPlane2Collection, kTRUE);
277 FairRootManager::Instance()->Register(
"Plane3Point",
"Plane3",
fPlane3Collection, kTRUE);
326 FairGeoLoader* PlanegeoLoad = FairGeoLoader::Instance();
327 FairGeoInterface* PlanegeoFace = PlanegeoLoad->getGeoInterface();
329 PlaneGeo->setGeomFile(GetGeometryFileName());
330 PlanegeoFace->addGeoModule(PlaneGeo);
332 Bool_t rc = PlanegeoFace->readSet(PlaneGeo);
333 if (rc) PlaneGeo->create(PlanegeoLoad->getGeoBuilder());
334 TList* volList = PlaneGeo->getListOfVolumes();
337 FairRun *
fRun = FairRun::Instance();
338 FairRuntimeDb *
rtdb= FairRun::Instance()->GetRuntimeDb();
343 TListIter iter(volList);
344 FairGeoNode* node = NULL;
345 FairGeoVolume *aVol=NULL;
347 while( (node = (FairGeoNode*)iter.Next()) ) {
348 aVol =
dynamic_cast<FairGeoVolume*
> ( node );
349 if ( node->isSensitive() ) {
350 fSensNodes->AddLast( aVol );
352 fPassNodes->AddLast( aVol );
356 ProcessNodes ( volList );
358 par->setInputVersion(fRun->GetRunId(),1);
363 CbmPlanePoint*
CbmPlane::AddHit1(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut,
Double_t time,
Double_t length,
Double_t eLoss,
Double_t charge,
Double_t mass,
Bool_t preflag,
Bool_t postflag,
TString nam,Int_t
evt)
367 Int_t size = clref.GetEntriesFast();
369 return new(clref[size])
CbmPlanePoint(trackID, detID, posIn, posOut,
370 momIn, momOut, time, length, eLoss, charge,
375 CbmPlanePoint*
CbmPlane::AddHit2(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut,
Double_t time,
Double_t length,
Double_t eLoss,
Double_t charge,
Double_t mass,
Bool_t preflag,
Bool_t postflag,
TString nam,Int_t
evt)
378 Int_t size = clref.GetEntriesFast();
379 return new(clref[size])
CbmPlanePoint(trackID, detID, posIn, posOut,
380 momIn, momOut, time, length, eLoss, charge,
385 CbmPlanePoint*
CbmPlane::AddHit3(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut,
Double_t time,
Double_t length,
Double_t eLoss,
Double_t charge,
Double_t mass,
Bool_t preflag,
Bool_t postflag,
TString nam,Int_t
evt)
388 Int_t size = clref.GetEntriesFast();
389 return new(clref[size])
CbmPlanePoint(trackID, detID, posIn, posOut,
390 momIn, momOut, time, length, eLoss, charge,
TLorentzVector fMomIn
position
sim(Int_t nEvents=1, TString SimEngine="TGeant4", Float_t mom=6.231552)
CbmPlanePoint * AddHit2(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss, Double_t charge, Double_t mass, Bool_t preflag, Bool_t postflag, TString nam, Int_t evt)
TClonesArray * fPlane2Collection
Hit collection.
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
virtual void EndOfEvent()
Double_t fcharge
MC volume ID of Plane.
virtual void ConstructGeometry()
CbmPlanePoint * AddHit1(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss, Double_t charge, Double_t mass, Bool_t preflag, Bool_t postflag, TString nam, Int_t evt)
virtual Bool_t ProcessHits(FairVolume *vol=0)
TClonesArray * fPlane3Collection
Hit collection.
TLorentzVector fPosIn
volume id
virtual void Initialize()
TClonesArray * fPlane1Collection
Int_t fevent
Hit collection.
Int_t fVolumeID
track index
Int_t fPosIndex
energy loss
virtual void Print() const
virtual void BeginEvent()
TObjArray * GetGeoPassiveNodes()
CbmPlanePoint * AddHit3(Int_t trackID, Int_t detID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss, Double_t charge, Double_t mass, Bool_t preflag, Bool_t postflag, TString nam, Int_t evt)
virtual TClonesArray * GetCollection(Int_t iColl) const
TObjArray * GetGeoSensitiveNodes()