88 #include <TClonesArray.h> 89 #include <TGeoGlobalMagField.h> 90 #include <TGeoManager.h> 91 #include <TRotMatrix.h> 94 #include <TVirtualMC.h> 259 fmd->ExtractGeomInfo();
266 Double_t density = 0;
267 Double_t radiationLength = 0;
268 Double_t absorbtionLength = 999;
269 Int_t fieldType = ((
AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
270 Double_t maxField = ((
AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
271 Double_t maxBending = 0;
272 Double_t maxStepSize = 0.001;
273 Double_t maxEnergyLoss = 1;
274 Double_t precision = 0.001;
275 Double_t minStepSize = 0.001;
281 radiationLength = 9.36;
287 AliMaterial(
id,
"Si$", a, z, density, radiationLength, absorbtionLength);
289 maxStepSize,maxEnergyLoss,precision,minStepSize);
296 radiationLength = 18.8;
302 AliMaterial(
id,
"Carbon$", a, z, density, radiationLength, absorbtionLength);
304 maxStepSize,maxEnergyLoss,precision,minStepSize);
310 radiationLength = 8.9;
312 AliMaterial(
id,
"Aluminum$",a,z, density, radiationLength, absorbtionLength);
313 AliMedium(
kAlId,
"Aluminum$",
id, 0, fieldType, maxField, maxBending,
314 maxStepSize, maxEnergyLoss, precision, minStepSize);
321 radiationLength = 1.43;
324 a, z, density, radiationLength, absorbtionLength);
326 maxStepSize, maxEnergyLoss, precision, minStepSize);
331 Float_t as[] = { 12.0107, 14.0067, 15.9994,
332 1.00794, 28.0855, 107.8682 };
333 Float_t zs[] = { 6., 7., 8.,
335 Float_t ws[] = { 0.039730642, 0.001396798, 0.01169634,
336 0.004367771, 0.844665, 0.09814344903 };
343 AliMixture(
id,
"Si Chip$", as, zs, density, 6, ws);
345 maxStepSize, maxEnergyLoss, precision, minStepSize);
350 Float_t as[] = { 1.00794, 12.0107, 14.010, 15.9994};
351 Float_t zs[] = { 1., 6., 7., 8.};
352 Float_t ws[] = { 0.026362, 0.69113, 0.07327, 0.209235};
359 AliMixture(
id,
"Kaption$", as, zs, density, 4, ws);
361 maxStepSize,maxEnergyLoss,precision,minStepSize);
366 Float_t as[] = { 12.0107, 14.0067, 15.9994, 39.948 };
367 Float_t zs[] = { 6., 7., 8., 18. };
368 Float_t ws[] = { 0.000124, 0.755267, 0.231781, 0.012827 };
375 AliMixture(
id,
"Air$", as, zs, density, 4, ws);
377 maxStepSize,maxEnergyLoss,precision,minStepSize);
382 Float_t zs[] = { 14., 20., 13., 12.,
386 Float_t as[] = { 28.0855, 40.078, 26.981538, 24.305,
387 10.811, 47.867, 22.98977, 39.0983,
388 55.845, 18.9984, 15.9994, 12.0107,
390 Float_t ws[] = { 0.15144894, 0.08147477, 0.04128158, 0.00904554,
391 0.01397570, 0.00287685, 0.00445114, 0.00498089,
392 0.00209828, 0.00420000, 0.36043788, 0.27529426,
393 0.01415852, 0.03427566};
400 AliMixture(
id,
"PCB$", as, zs, density, 14, ws);
402 maxStepSize,maxEnergyLoss,precision,minStepSize);
407 Float_t as[] = { 55.847, 51.9961, 58.6934, 28.0855 };
408 Float_t zs[] = { 26., 24., 28., 14. };
409 Float_t ws[] = { .715, .18, .1, .005 };
412 AliMixture(
id,
"Steel$", as, zs, density, 4, ws);
414 maxStepSize, maxEnergyLoss, precision, minStepSize);
418 Float_t as[] = { 1.01, 12.01 };
419 Float_t zs[] = { 1., 6. };
420 Float_t ws[] = { 1., 1. };
427 AliMixture(
id,
"Plastic$", as, zs, density, -2, ws);
429 maxStepSize,maxEnergyLoss,precision,minStepSize);
437 AliFMD::SetTrackingParameters(Int_t imed,
440 Float_t neutral_hadron,
441 Float_t charged_hadron,
443 Float_t electron_bremstrahlung,
444 Float_t muon__bremstrahlung,
445 Float_t electron_delta,
450 Int_t compton_scattering,
455 Int_t multiple_scattering,
456 Int_t pair_production,
457 Int_t photon_production,
458 Int_t rayleigh_scattering)
461 if (!TVirtualMC::GetMC())
return;
463 Int_t iimed = idtmed[imed];
494 AliFMDDebug(1, (
"Initialising FMD detector object"));
495 TVirtualMC* mc = TVirtualMC::GetMC();
499 if (actGeo.fN <= 0) valid =
false;
501 for (
int i = 0; i < actGeo.fN; i++) {
509 AliFMDDebug(1, (
"Extracting geometry info from loaded geometry"));
513 TArrayI actVmc(actGeo.fN);
514 for (Int_t i = 0; i < actGeo.fN; i++) {
516 AliError(Form(
"Invalid id: %d", actGeo[i]));
519 TGeoVolume *sens =
gGeoManager->GetVolume(actGeo[i]);
521 AliError(Form(
"No TGeo volume for sensitive volume ID=%d",actGeo[i]));
524 actVmc[i] = mc->VolId(sens->GetName());
525 AliFMDDebug(1, (
"Active vol id # %d: %d changed to %d",
526 i, actGeo[i], actVmc[i]));
528 fmd->
SetActive(actVmc.fArray, actVmc.fN);
540 if (
fBad &&
fBad->GetEntries() > 0) {
544 while ((hit = static_cast<AliFMDHit*>(next()))) hit->
Print(
"D");
567 const Int_t kBufferSize = 16000;
568 TString branchname(GetName());
571 if (opt.Contains(
"H", TString::kIgnoreCase)) {
575 if (opt.Contains(
"D", TString::kIgnoreCase)) {
580 if (opt.Contains(
"S", TString::kIgnoreCase)) {
598 TBranch* branch = treeD->GetBranch (
"FMD");
599 if (branch) branch->SetAddress(&
fDigits);
605 TBranch* branch = treeS->GetBranch (
"FMD");
606 if (branch) branch->SetAddress(&
fSDigits);
615 b->SetAddress(&
fHits);
713 for (Int_t i = 0; i <
fNhits; i++) {
714 if (!a.At(i))
continue;
717 && hit->
Ring() == ring
718 && hit->
Sector() == sector
719 && hit->
Strip() == strip
721 AliFMDDebug(1, (
"already had a hit in FMD%d%c[%2d,%3d] for track # %d," 722 " adding energy (%f) to that hit (%f) -> %f",
723 detector, ring, sector, strip, track, edep, hit->
Edep(),
724 hit->
Edep() + edep));
731 strip, x, y, z, px, py, pz, edep, pdg, t,
746 trackRef->
SetUserId((dedx << 19) | stripId);
804 AliFMDDebug(15, (
"Adding digit # %5d/%5d for FMD%d%c[%2d,%3d]" 805 "=(%d,%d,%d,%d) with %d tracks",
807 detector, ring, sector, strip,
808 count1, count2, count3, count4, nrefs));
811 count1, count2, count3, count4, nrefs, refs);
842 UShort_t(digits[10]));
876 AliFMDDebug(15, (
"Adding sdigit # %5d/%5d for FMD%d%c[%2d,%3d]" 877 "=(%d,%d,%d,%d) with %d tracks %d primaries (%p)",
879 detector, ring, sector, strip,
880 count1, count2, count3, count4, ntot, nprim, refs));
883 count1, count2, count3, count4, ntot, nprim, refs);
903 fHits =
new TClonesArray(
"AliFMDHit", 1000);
917 fDigits =
new TClonesArray(
"AliFMDDigit", 1000);
929 fSDigits =
new TClonesArray(
"AliFMDSDigit", 1000);
973 #ifdef USE_SSDIGITIZER 974 digitizer =
new AliFMDSSDigitizer(digInput);
978 AliInfo(
"SDigit->Digit conversion not really supported, " 979 "doing Hit->Digit conversion instead");
1018 TClonesArray* sdigits =
SDigits();
1028 UShort_t ns = sdigits->GetEntriesFast();
1030 for (UShort_t i = 0; i < ns; i++)
1031 sdigits->At(i)->Print(
"pl");
1033 AliFMDDebug(1, (
"Got a total of %d SDigits", ns));
1070 AliInfo(
"Add FMD alignable volumes");
1073 for(
size_t f = 1;
f <= 3;
f++){
1074 for(
size_t tb = 0; tb <2 ; tb++){
1075 char stb = tb == 0 ?
'T' :
'B';
1076 unsigned min = tb == 0 ? 0 : 5;
1078 TString halfVol(Form(
"/ALIC_1/F%dM%c_%d",
f, stb,
f));
1079 TString halfSym(halfVol);
1080 if(!
gGeoManager->SetAlignableEntry(halfSym.Data(),halfVol.Data()))
1081 AliFatal(Form(
"Alignable entry %s not created. " 1082 "Volume path %s not valid",
1083 halfSym.Data(),halfVol.Data()));
1084 for(
size_t io = 0; io < 2; io++){
1085 if (
f==1 && io==1)
continue;
1086 if(tb == 1 && io==1) min=10;
1087 char sio = (io == 0 ?
'I' :
'O');
1088 unsigned nio = (io == 0 ? 3 : 9);
1089 unsigned max = (io == 0 ? 5 : 10) + min;
1091 for(
size_t i = min; i < max; i++) {
1092 TString modVol(Form(
"%s/F%c%cV_7%d/F%cSE_%d", halfVol.Data(),
1093 sio, stb, nio, sio, i));
1094 TString modSym(modVol);
1095 if(!
gGeoManager->SetAlignableEntry(modSym.Data(),modVol.Data()))
1096 AliFatal(Form(
"Alignable entry %s not created. " 1097 "Volume path %s not valid",
1098 modSym.Data(), modVol.Data()));
void SetDetailed(Bool_t det)
TList * GetHitLists() const
virtual void SetUserId(Int_t userId)
virtual void Hits2SDigits()
TClonesArray * fHits
Counter for the hit iterator.
virtual void AddAlignableVolumes() const
virtual void SetHitsAddressBranch(TBranch *b)
virtual void AddDigitByFields(UShort_t detector=0, Char_t ring='\0', UShort_t sector=0, UShort_t strip=0, UShort_t count1=0, Short_t count2=-1, Short_t count3=-1, Short_t count4=-1, UShort_t nrefs=0, Int_t *refs=0)
void SetEdep(Float_t edep)
Geometry mananger for the FMD.
virtual void AliMedium(Int_t numed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Float_t fieldm, Float_t tmaxfd, Float_t stemax, Float_t deemax, Float_t epsil, Float_t stmin, Float_t *ubuf=0, Int_t nbuf=0) const
virtual void AddDigit(Int_t *digits, Int_t *notused=0)
virtual void AddSDigit(Int_t *digits)
virtual void SetTreeAddress()
virtual void ResetSDigits()
virtual void SetAlignableVolumes() const
virtual void AliMixture(Int_t imat, const char *name, Float_t *a, Float_t *z, Float_t dens, Int_t nlmat, Float_t *wmat) const
Class to write ALTRO formated raw data from an array of AliFMDDigit objects.
Manager of FMD parameters.
FMD ring geometry parameters.
virtual void AddSDigitByFields(UShort_t detector=0, Char_t ring='\0', UShort_t sector=0, UShort_t strip=0, Float_t edep=0, UShort_t count1=0, Short_t count2=-1, Short_t count3=-1, Short_t count4=-1, UShort_t ntot=0, UShort_t nprim=0, Int_t *refs=0)
Forward Multiplicity Detector based on Silicon wafers. This class is the driver for especially simula...
Int_t fNdigits
Number of hits.
virtual void CreateGeometry()
FMD Digitizers declaration.
#define AliWarning(message)
virtual void Digits2Raw()
FMD Digitizers declaration.
Concrete digitizer to make digits from hits. See also AliFMDBaseDigitizer documentation.
virtual void CreateMaterials()
virtual void Browse(TBrowser *b)
virtual void SetSDigitsAddressBranch(TBranch *b)
virtual void MakeBranch(Option_t *opt=" ")
AliLoader * fLoader
List of digits for this detector.
virtual void MakeBranch(Option_t *opt=" ")
virtual Int_t WriteSDigits(Option_t *opt="") const
void Digitize(Option_t *option="")
TClonesArray * HitsArray()
This is a class that reconstructs AliFMDRecPoint objects from of Digits.
virtual void AliMaterial(Int_t imat, const char *name, Float_t a, Float_t z, Float_t dens, Float_t radl, Float_t absl, Float_t *buf=0, Int_t nwbuf=0) const
TClonesArray * fDigits
List of hits for one track only.
Singleton object of FMD geometry descriptions and parameters. This class is a singleton that handles ...
virtual TClonesArray * SDigits()
Declaration of AliFMD detector driver.
static UInt_t Pack(UShort_t det, Char_t rng, UShort_t sec, UShort_t str)
virtual void SetTreeAddress()
virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits)
UShort_t Detector() const
TGeoManager * gGeoManager
virtual Bool_t Raw2SDigits(AliRawReader *reader)
#define AliFMDDebug(N, A)
void rec(const char *filename="raw.root")
static AliFMDParameters * Instance()
virtual TBranch * MakeBranchInTree(TTree *tree, const char *cname, void *address, Int_t size=32000, const char *file=0)
void Print(Option_t *opt="") const
Int_t GetCurrentTrackNumber() const
virtual TArrayI * GetIdtmed() const
Concrete digitizer to make digits from hits. See also AliFMDBaseDigitizer documentation.
#define AliFatal(message)
virtual void Exec(Option_t *option="")
void SetActive(Int_t *active, Int_t n)
void UseAssembly(Bool_t ass)
Double_t GetSiDensity() const
virtual AliFMDHit * AddHitByFields(Int_t track, UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip, Float_t x=0, Float_t y=0, Float_t z=0, Float_t px=0, Float_t py=0, Float_t pz=0, Float_t edep=0, Int_t pdg=0, Float_t t=0, Float_t len=0, Bool_t stopped=kFALSE)
virtual AliDigitizer * CreateDigitizer(AliDigitizationInput *digInput) const
virtual AliTrackReference * AddTrackReference(Int_t label, Int_t id=-999)
class for summable digits
virtual void Hits2Digits()
AliFMDhit is the hit class for the FMD. Hits are the information that comes from a Monte Carlo at eac...
virtual void FinishEvent()
void MakeTree(Option_t *option)
TClonesArray * DigitsArray()
static Int_t GetDebugLevel(const char *module, const char *className)
#define AliError(message)
const TArrayI & ActiveIds() const
static UInt_t Encode(Double_t edep, Double_t length)
static AliFMDGeometry * Instance()
virtual void Digitize(AliRawReader *reader, TClonesArray *sdigits) const
Sub-detector base class declaration.
TClonesArray * SDigitsArray()
virtual void AddHitList(TCollection *hitList)
UShort_t Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll)
Base class for digitizers.