Day3 - Geant4 Hits

Geant4 and Calorimetry in HEP



A gamma beam of 10 GeV is directed in positive z-direction.

The setup consists of a single box containing 10 sandwich layers of 5mm Lead and 10mm Scintillator (z direction). The x and y dimensions are 50 cm.



In this exercise you will modify the code of the SimpleHit class and the sensitive detector ScintillatorSD class.

The SimpleHit is the hit concrete class to accumulate energy deposited in the layers of the hadronic calorimeter, the ScintillatorSD (see previous exercise) is used to create and manipulate hits.

The hit class is defined in src/ file. You will have to edit also the src/ file.

In addition an Analysis object is provided to create root output.

Exercise 1: create hit collection to store hits

Please provide a ScintillatorSD::Initialize method like.

void ScintillatorSD::Initialize(G4HCofThisEvent* HCE)
   // ------------------------------
  // -- Creation of the collection
  // ------------------------------
  // -- collectionName[0] is "SiHitCollection", as declared in constructor
  std::cout<<"create new hitcollection "<<GetName()<<" "<<collectionName[0]<<std::endl;
  hitCollection = new SiHitCollection(GetName(), collectionName[0]);

  // ----------------------------------------------------------------------------
  // -- and attachment of this collection to the "Hits Collection of this Event":
  // ----------------------------------------------------------------------------
  // -- To insert the collection, we need to get an index for it. This index
  // -- is unique to the collection. It is provided by the GetCollectionID(...)
  // -- method (which calls what is needed in the kernel to get this index).
  static G4int HCID = -1;
  if (HCID<0) HCID = GetCollectionID(0); // <<-- this is to get an ID for collectionName[0]
  HCE->AddHitsCollection(HCID, hitCollection);

Exercise 2 : Modify Hit class to add print-out on screen

Exercise 3: Activate the analysis

Generated on Thu May 12 14:04:36 2011