#ifdef __CINT__
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-
+
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ enum ECRMode;
-
+
#pragma link C++ class AliACORDE+;
#pragma link C++ class AliACORDEConstants+;
-#pragma link C++ class AliACORDEdigit+;
-#pragma link C++ class AliACORDEhit+;
+#pragma link C++ class AliACORDELoader+;
#pragma link C++ class AliGenACORDE+;
-#pragma link C++ class AliACORDEModule+;
-#pragma link C++ class AliACORDECalibModule+;
-#pragma link C++ class AliACORDEDataModule+;
-#pragma link C++ class AliACORDEPreprocessor+;
+#pragma link C++ class AliACORDECalibData+;
+
#endif
#pragma link C++ class AliACORDEv0+;
-#pragma link C++ class AliACORDEv1+;
+#pragma link C++ class AliACORDEhit+;
+#pragma link C++ class AliACORDEdigit+;
+#pragma link C++ class AliACORDEDigitizer+;
+#pragma link C++ class AliACORDETrigger+;
+#pragma link C++ class AliACORDERawData+;
#endif
#include <TClonesArray.h>
#include <TTree.h>
#include <TVirtualMC.h>
+#include <TGeoManager.h>
#include "AliACORDE.h"
-#include "AliACORDEModule.h"
#include "AliMagF.h"
#include "AliRun.h"
+#include "AliACORDERawData.h"
ClassImp(AliACORDE)
//_____________________________________________________________________________
AliACORDE::AliACORDE()
: AliDetector(),
- fModule(0)
+ fCreateCavern(0),
+ fITSGeometry(0)
{
//
// Default constructor
//_____________________________________________________________________________
AliACORDE::AliACORDE(const char *name, const char *title)
: AliDetector(name, title),
- fModule(0)
+ fCreateCavern(kFALSE),
+ fITSGeometry(kTRUE)
+
{
//
// Standard constructor
- //
- //fHits = new TClonesArray("AliACORDEhit", 400);
- //gAlice->GetMCApp()->AddHitList(fHits);
}
//_____________________________________________________________________________
//
// Default destructor
//
- if ( fModule ) { delete fModule; fModule = 0; }
}
//_____________________________________________________________________________
AliDetector::MakeBranch(opt);
}
+AliLoader* AliACORDE::MakeLoader(const char* topfoldername)
+{
+
+ AliDebug(1,Form("Creating AliACORDELoader, Top folder is %s ",
+ topfoldername));
+ fLoader = new AliACORDELoader(GetName(),topfoldername);
+ return fLoader;
+}
+
+
+AliDigitizer* AliACORDE::CreateDigitizer(AliRunDigitizer* manager) const
+{
+ //
+ //
+ return new AliACORDEDigitizer(manager);
+}
+
+void AliACORDE::Digits2Raw()
+{
+ // Produce Raw data starting from digits
+ // 1. Get digits
+ // 2. From digits get an array with the state of the modules
+ // 3. Unload digits
+ // 4. Write raw data
+
+ // 1. Get digits
+
+ // 1.1 Get detector, load digits and set branch
+ AliACORDE* acorde = (AliACORDE*)gAlice->GetDetector("ACORDE");
+ fLoader->LoadDigits("READ");
+ TTree* treeD = fLoader->TreeD();
+ if (!treeD) {
+ Error("Digits2Raw", "no digits tree");
+ return;
+ }
+ TClonesArray *adigits = new TClonesArray ("AliACORDEdigit", 1000);
+ treeD->GetBranch("ACORDEdigit")->SetAddress(&adigits);
+ // 1.2 Get first entry (there is always only one)
+ acorde->ResetDigits();
+ treeD->GetEvent(0);
+
+ // 2. From digits get an array with the state of the modules
+ // 2.1 Define and initialize the array
+ Bool_t Modules[60];
+ for (Int_t i=0;i<60;i++) Modules[i]= kFALSE;
+ // 2.2 Loop over all digits
+ Int_t ndig = adigits->GetEntriesFast();
+ for (Int_t idig=0;idig<ndig;idig++) {
+ // 2.3 set the array entry for each digit
+ AliACORDEdigit* digit = (AliACORDEdigit*) adigits->At(idig);
+ Int_t mod = digit->GetModule();
+ Modules[mod-1]=kTRUE;
+ }
+ // 3. Unload digits
+ fLoader->UnloadDigits();
+
+ // 4. Write raw data
+ AliACORDERawData rawdata;
+ rawdata.WriteACORDERawData(Modules);
+}
+
//_____________________________________________________________________________
void AliACORDE::AddAlignableVolumes() const
{
////////////////////////////////////////////////
#include "AliDetector.h"
-#include <TGeoManager.h>
+#include "AliACORDELoader.h"
+#include "AliACORDEDigitizer.h"
+#include "AliACORDETrigger.h"
class AliACORDEModule;
virtual TString Version() { return TString(""); }
virtual void SetTreeAddress();
- virtual void SetModule(AliACORDEModule* module) {fModule = module;}
- virtual const AliACORDEModule* GetModule() const {return fModule; }
virtual void MakeBranch(Option_t* opt = "");
virtual void AddAlignableVolumes() const;
-protected:
- AliACORDEModule* fModule;
+ virtual AliLoader* MakeLoader(const char* topfoldername);
+
+ AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
+
+ virtual AliTriggerDetector* CreateTriggerDetector() const
+ { return new AliACORDETrigger(); }
+
+ void Digits2Raw ();
+ virtual void SetCreateCavern(Bool_t b) {fCreateCavern = b;}
+ virtual void SetITSGeometry(Bool_t b) {fITSGeometry = b;}
+ virtual Bool_t GetCreateCavern() const {return fCreateCavern;}
+ virtual Bool_t GetITSGeometry() const {return fITSGeometry;}
+
private:
AliACORDE(const AliACORDE& crt);
AliACORDE& operator=(const AliACORDE& crt);
+ Bool_t fCreateCavern;
+ Bool_t fITSGeometry;
+
ClassDef(AliACORDE, 1) // Cosmic Ray Trigger (ACORDE) base class
};
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id: AliACORDECalibData.cxx, */
+
+
+#include "AliACORDECalibData.h"
+
+ClassImp(AliACORDECalibData)
+
+//________________________________________________________________
+AliACORDECalibData::AliACORDECalibData()
+{
+
+}
+
+//________________________________________________________________
+void AliACORDECalibData::Reset()
+{
+
+}
+
+//________________________________________________________________
+AliACORDECalibData::AliACORDECalibData(const char* name)
+{
+ TString namst = "Calib_";
+ namst += name;
+ SetName(namst.Data());
+ SetTitle(namst.Data());
+
+}
+
+//________________________________________________________________
+AliACORDECalibData::AliACORDECalibData(const AliACORDECalibData& calibda) :
+ TNamed(calibda)
+{
+// copy constructor
+
+ SetName(calibda.GetName());
+ SetTitle(calibda.GetName());
+
+ // there are 60 modules. Note that number of first module is 1 (one)
+ for(int t=0; t<60; t++)
+ {
+ fEfficiencies[t] =calibda.GetEfficiency(t+1);
+ fRates[t] = calibda.GetRate(t+1);
+ }
+}
+
+//________________________________________________________________
+AliACORDECalibData &AliACORDECalibData::operator =(const AliACORDECalibData& calibda)
+{
+// assignment operator
+
+ SetName(calibda.GetName());
+ SetTitle(calibda.GetName());
+ // there are 60 modules. Note that number of first module is 1 (one)
+ for(int t=0; t<60; t++)
+ {
+ fEfficiencies[t] =calibda.GetEfficiency(t+1);
+ fRates[t] = calibda.GetRate(t+1);
+ }
+ return *this;
+}
+
+//________________________________________________________________
+AliACORDECalibData::~AliACORDECalibData()
+{
+
+}
+
+
+
+//________________________________________________________________
+void AliACORDECalibData::SetEfficiencies(Float_t* Eff)
+{
+ // there are 60 modules. Note that number of first module is 1 (one)
+ if(Eff) for(int t=0; t<60; t++) fEfficiencies[t] = Eff[t];
+ else for(int t=0; t<60; t++) fEfficiencies[t] = 0.0;
+}
+
+void AliACORDECalibData::SetRates(Float_t* Rt)
+{
+ if(Rt) for (int t=0;t<60; t++) fRates[t] = Rt[t];
+else for (int t=0;t<60; t++) fRates[t] = 0.0;
+}
--- /dev/null
+#ifndef ALIACORDECALIBDATA_H
+#define ALIACORDECALIBDATA_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+#include "TNamed.h"
+class AliACORDECalibData: public TNamed {
+
+ public:
+ AliACORDECalibData();
+ AliACORDECalibData(const char* name);
+ AliACORDECalibData(const AliACORDECalibData &calibda);
+ AliACORDECalibData& operator= (const AliACORDECalibData &calibda);
+ virtual ~AliACORDECalibData();
+ void Reset();
+
+ Float_t* GetEfficiencies() const { return (float*)fEfficiencies; }
+ Float_t GetEfficiency(Int_t i) const { return fEfficiencies[i-1];}
+ Float_t* GetRates() const {return (float*)fRates;}
+ Float_t GetRate(Int_t i) const {return fRates[i-1];}
+ void SetRates(Float_t* Rt);
+ void SetRate(Float_t rate, Int_t mod){fRates[mod-1]=rate;}
+ void SetEfficiencies(Float_t* Eff);
+ void SetEfficiency(Float_t eff, Int_t mod) {fEfficiencies[mod-1]=eff;}
+
+ protected:
+ Float_t fEfficiencies[60];
+ Float_t fRates[60];
+
+ ClassDef(AliACORDECalibData,1) // ACORDE Calibration data
+};
+
+#endif
+
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// class for ACORDE calibration //
-// Pedro Gonzalez Zamora pedro.gonzalez@fcfm.buap.mx //
-// Irais Bautista Guzman irais@fcfm.buap.mx //
-// Arturo Fernandez Tellez afernan@cern.ch //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-
-#include "AliACORDECalibModule.h"
-#include "AliACORDEDataModule.h"
-#include "AliLog.h"
-#include <TCanvas.h>
-
-
-ClassImp(AliACORDECalibModule)
-
-
-//________________________________________________________________
-
-AliACORDECalibModule::AliACORDECalibModule():
-TObject(),
-fHRate(0x0)
-{
-
-
- // Default constructor
- for(int i=0;i<kNmodules;i++)
- fModule[i]=0x0;
-
-
-}
-//________________________________________________________________
-AliACORDECalibModule::AliACORDECalibModule(const AliACORDECalibModule &calibdata):
-TObject(),
-fHRate(calibdata.fHRate)
-{
- //copy constructor
-
- for (Int_t i=0;i<kNmodules;i++)
- {
- fModule[i]=calibdata.fModule[i];
-
- }
-
-
-}
-//_______________________________________________________________
-AliACORDECalibModule& AliACORDECalibModule:: operator=(const AliACORDECalibModule & calibdata)
-{
-//assignment operator
- for(Int_t i=0;i<kNmodules;i++)
- {
- this->fModule[i]=calibdata.GetModule(i);
-
- }
-
- this->fHRate=calibdata.fHRate;
-
- return *this;
-}
-
-
-
-//________________________________________________________________
-AliACORDECalibModule::~AliACORDECalibModule()
-{
-
- // Destructor
-
-}
-
-
-//________________________________________________________________
-void AliACORDECalibModule::SetModule(Int_t module,Float_t value,Bool_t status,const char* name)
-{
-
- fModule[module] = new AliACORDEDataModule(value,status,name);
- //Set values for each module
-}
-//________________________________________________________________
-void AliACORDECalibModule::SetModuleRate(Int_t module, Float_t value)
-{
- // Set RATE value
-
- fModule[module]->SetRate(value);
-}
-//________________________________________________________________
-
-Float_t AliACORDECalibModule::GetModuleRate(Int_t module)
-{
-
- return fModule[module]->GetRate();
-}
-//________________________________________________________________
-
-void AliACORDECalibModule::Create_Histo()
-{
- //Create histogram of modules rates actual values
-
-
- fHRate = new TH1F("fHRate","RATES PER MODULE",60,0,60);
-
-
- for(int i=0;i<kNmodules;i++)
- fHRate->Fill(i,fModule[i]->GetRate());
-
-}
-//_____________________________________________________________________
-void AliACORDECalibModule::Draw(const Option_t* /*option*/) //Draw the Histogram RATE_MODULE
-{
- TCanvas *c1 = new TCanvas
- ("RATES","RATES PER MODULE",200,10,700,500);
- c1->cd();
- fHRate->Draw();
-}
-
-//______________________________________________________________________
-void AliACORDECalibModule::Print_Module() // Print the status and rates for each module
-{
-
-
- for(int module=0;module<kNmodules;module++)
- AliInfo(Form("%s con rate %f Status %d \n",fModule[module]->GetName(),fModule[module]->GetRate(),fModule[module]->GetStatus()));
-
-}
+++ /dev/null
-#ifndef AliACORDECalibModule_H
-#define AliACORDECalibModule_H
-
-////////////////////////////////////////////////
-// class for ACORDE calibration //
-////////////////////////////////////////////////
-
-#include "TObject.h"
-#include "TH1F.h"
-
-class AliACORDEDataModule;
-
-class AliACORDECalibModule: public TObject
-{
-
- public:
- enum {kNmodules=60};
- AliACORDECalibModule();
- AliACORDECalibModule(const AliACORDECalibModule &calibdata);
- AliACORDECalibModule& operator=(const AliACORDECalibModule & calibdata);
- virtual ~AliACORDECalibModule();
- void Print_Module();
- AliACORDEDataModule* GetModule(Int_t module) const {return fModule[module];}
- void SetModuleRate(Int_t module,Float_t value);
- Float_t GetModuleRate(Int_t module);
- void SetModule(Int_t module, Float_t value, Bool_t status,const char* name);
- void Create_Histo();
- void Draw(const Option_t* /*option*/);
-
-
- protected:
- AliACORDEDataModule *fModule[kNmodules];
- TH1F *fHRate;
- ClassDef(AliACORDECalibModule,1) // ACORDE Calibration data
-};
-
-#endif
AliACORDEConstants* AliACORDEConstants::fgInstance = 0;
-const Float_t AliACORDEConstants::fgkCageLenght = 477.6;
-const Float_t AliACORDEConstants::fgkCageWidth = 166.7;
-const Float_t AliACORDEConstants::fgkCageHeight = 10.7;
-const Float_t AliACORDEConstants::fgkSinglePaletteLenght = 363.0;
-const Float_t AliACORDEConstants::fgkSinglePaletteWidth = 19.7;
-const Float_t AliACORDEConstants::fgkSinglePaletteHeight = 1;
-const Float_t AliACORDEConstants::fgkActiveAreaGap = 0.7;
-const Float_t AliACORDEConstants::fgkActiveAreaLenght = AliACORDEConstants::fgkSinglePaletteLenght;
-const Float_t AliACORDEConstants::fgkActiveAreaWidth = 156.7;
-const Float_t AliACORDEConstants::fgkActiveAreaHeight = 2*AliACORDEConstants::fgkSinglePaletteHeight + AliACORDEConstants::fgkActiveAreaGap;
-const Float_t AliACORDEConstants::fgkMagnetWidth = 654.4;
-const Float_t AliACORDEConstants::fgkMagnetLenght = 1200;
-const Float_t AliACORDEConstants::fgkMagMinRadius = 790;
-const Float_t AliACORDEConstants::fgkMagMaxRadius = AliACORDEConstants::fgkMagMinRadius + 20;
-const Float_t AliACORDEConstants::fgkDepth =4420; // cm
+const Float_t AliACORDEConstants::fgkModuleLength = 300.0;
+const Float_t AliACORDEConstants::fgkModuleWidth = 26.0;
+const Float_t AliACORDEConstants::fgkModuleHeight = 10.0;
+const Float_t AliACORDEConstants::fgkPlasticLength = 190.0;
+const Float_t AliACORDEConstants::fgkPlasticWidth = 20.0;
+const Float_t AliACORDEConstants::fgkPlasticHeight = 1.0;
+const Float_t AliACORDEConstants::fgkProfileWidth = 3.8;
+const Float_t AliACORDEConstants::fgkProfileThickness = 0.3;
+const Float_t AliACORDEConstants::fgkDepth =4420;
+
+const Float_t AliACORDEConstants::fgkHitEnergyThreshold = 1.52; // MeV
+const Float_t AliACORDEConstants::fgkMaxHitTimeDifference = 40.0; // ns
+const Int_t AliACORDEConstants::fgkMultiMuonThreshold = 2;
+const Float_t AliACORDEConstants::fgkMultiMuonWindow = 25;
+const Float_t AliACORDEConstants::fgkModulePositionX[60] = {
+ 641, 641, 641, 641, 641, 641, 641, 641, 641, 641,
+ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426,
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ -153, -153, -153, -153, -153, -153, -153, -153, -153,
+ -153, -426, -426, -426, -426, -426, -426, -426, -426,
+ -426, -426, -644, -644, -644, -644, -644, -619, -623,
+ -641, -641, -641};
+const Float_t AliACORDEConstants::fgkModulePositionY[60] = {
+ 582, 582, 582, 582, 582, 582, 582, 582, 582, 582,
+ 797, 797, 797, 797, 797, 797, 797, 797, 797, 797,
+ 850, 850, 850, 850, 850, 850, 850, 850, 850, 850,
+ 850, 850, 850, 850, 850, 850, 850, 850, 850, 850,
+ 797, 797, 797, 797, 797, 797, 797, 797, 797, 797,
+ 576, 576, 576, 576, 576, 609, 605, 582, 582, 582};
+const Float_t AliACORDEConstants::fgkModulePositionZ[60] = {
+ 450, 350, 250, 150, 50, -50, -120, -280, -350, -450,
+ 450, 350, 250, 150, 50, -50, -150, -250, -350, -450,
+ 450, 350, 250, 150, 50, -50, -150, -250, -350, -450,
+ 450, 350, 250, 150, 50, -50, -150, -250, -350, -450,
+ 450, 350, 250, 150, 50, -50, -150, -250, -350, -450,
+ 450, 350, 250, 104, 50, -76, -176, -250, -350, -450};
+
+const Float_t AliACORDEConstants::fgkExtraModulePositionZ[4] = {93.0, 18., -18, -93};
+const Float_t AliACORDEConstants::fgkExtraModulePositionX = 0.0;
+const Float_t AliACORDEConstants::fgkExtraModulePositionY = 850.0;
ClassImp(AliACORDEConstants)
// Default constructor
}
-//_____________________________________________________________________________
-AliACORDEConstants::AliACORDEConstants(const AliACORDEConstants& ct)
- : TObject(ct)
-{
- // Copy constructor
-}
-
-//_____________________________________________________________________________
-AliACORDEConstants& AliACORDEConstants::operator=(const AliACORDEConstants&)
-{
- // Asingment operator
- return *this;
-}
//_____________________________________________________________________________
AliACORDEConstants* AliACORDEConstants::Instance()
}
//_____________________________________________________________________________
-Float_t AliACORDEConstants::CageLenght() const
+Float_t AliACORDEConstants::ModulePositionX(Int_t i) const
{
// Module lenght
- return fgkCageLenght;
+ return fgkModulePositionX[i];
}
//_____________________________________________________________________________
-Float_t AliACORDEConstants::CageWidth() const
+Float_t AliACORDEConstants::ModulePositionY(Int_t i) const
{
- // Module width
- return fgkCageWidth;
+ // Module lenght
+ return fgkModulePositionY[i];
}
-
//_____________________________________________________________________________
-Float_t AliACORDEConstants::CageHeight() const
+Float_t AliACORDEConstants::ModulePositionZ(Int_t i) const
{
- // Module height
- return fgkCageHeight;
+ // Module lenght
+ return fgkModulePositionZ[i];
}
-//_____________________________________________________________________________
-Float_t AliACORDEConstants::SinglePaletteLenght() const
+Float_t AliACORDEConstants::ExtraModulePositionX() const
{
- // Lenght of the scintillator active zone for a single counter
- return fgkSinglePaletteLenght;
+ // Module lenght
+ return fgkExtraModulePositionX;
}
//_____________________________________________________________________________
-Float_t AliACORDEConstants::SinglePaletteWidth() const
+Float_t AliACORDEConstants::ExtraModulePositionY() const
{
- // Width of the scintillator active zone for a single counter
- return fgkSinglePaletteWidth;
+ // Module lenght
+ return fgkExtraModulePositionY;
}
-
//_____________________________________________________________________________
-Float_t AliACORDEConstants::SinglePaletteHeight() const
+Float_t AliACORDEConstants::ExtraModulePositionZ(Int_t i) const
{
- // Height of the scintillator active zone for a single counter
- return fgkSinglePaletteHeight;
+ // Module lenght
+ return fgkExtraModulePositionZ[i];
}
//_____________________________________________________________________________
-Float_t AliACORDEConstants::ActiveAreaGap() const
-{
- // Gap betwen scintillators
- return fgkActiveAreaGap;
+Float_t AliACORDEConstants::ModuleLength() const
+{
+ // Module lenght
+ return fgkModuleLength;
}
//_____________________________________________________________________________
-Float_t AliACORDEConstants::ActiveAreaLenght() const
+Float_t AliACORDEConstants::ModuleWidth() const
{
- // Lenght of the scintillator active zone
- return fgkActiveAreaLenght;
+ // Module width
+ return fgkModuleWidth;
}
//_____________________________________________________________________________
-Float_t AliACORDEConstants::ActiveAreaWidth() const
+Float_t AliACORDEConstants::ModuleHeight() const
{
- // Width of the scintillator active zone
- return fgkActiveAreaWidth;
+ // Module height
+ return fgkModuleHeight;
}
//_____________________________________________________________________________
-Float_t AliACORDEConstants::ActiveAreaHeight() const
+Float_t AliACORDEConstants::PlasticLength() const
{
- // Height of the scintillator active zone
- return fgkActiveAreaHeight;
+ // Length of the scintillator active zone for a single counter
+ return fgkPlasticLength;
}
//_____________________________________________________________________________
-Float_t AliACORDEConstants::MagnetWidth() const
+Float_t AliACORDEConstants::PlasticWidth() const
{
- // Magnet width
- return fgkMagnetWidth;
+ // Width of the scintillator active zone for a single counter
+ return fgkPlasticWidth;
}
//_____________________________________________________________________________
-Float_t AliACORDEConstants::MagnetLenght() const
+Float_t AliACORDEConstants::PlasticHeight() const
{
- // Magnet lenght
- return fgkMagnetLenght;
+ // Height of the scintillator active zone for a single counter
+ return fgkPlasticHeight;
}
-//_____________________________________________________________________________
-Float_t AliACORDEConstants::MagMinRadius() const
+Float_t AliACORDEConstants::ProfileWidth() const
{
- // Magnet Inner radius
- return fgkMagMinRadius;
+ // Width of the profile of the Al box
+ return fgkProfileWidth;
}
-//_____________________________________________________________________________
-Float_t AliACORDEConstants::MagMaxRadius() const
+Float_t AliACORDEConstants::ProfileThickness() const
{
- // Magnet outer radius
- return fgkMagMaxRadius;
+ // Thickness of the profile of the Al box
+ return fgkProfileThickness;
}
+
//_____________________________________________________________________________
Float_t AliACORDEConstants::Depth() const
{
static AliACORDEConstants* Instance();
- Float_t CageLenght() const;
- Float_t CageWidth() const;
- Float_t CageHeight() const;
-
- Float_t SinglePaletteLenght() const;
- Float_t SinglePaletteWidth() const;
- Float_t SinglePaletteHeight() const;
-
- Float_t ActiveAreaGap() const;
- Float_t ActiveAreaLenght() const;
- Float_t ActiveAreaWidth() const;
- Float_t ActiveAreaHeight() const;
-
- Float_t MagnetWidth() const;
- Float_t MagnetLenght() const;
- Float_t MagMinRadius() const;
- Float_t MagMaxRadius() const;
-
+ // constant for geometry
+ Float_t ModuleLength() const;
+ Float_t ModuleWidth() const;
+ Float_t ModuleHeight() const;
+ Float_t ModulePositionX(Int_t i) const;
+ Float_t ModulePositionY(Int_t i) const;
+ Float_t ModulePositionZ(Int_t i) const;
+ Float_t ExtraModulePositionZ(Int_t i) const;
+ Float_t ExtraModulePositionX() const;
+ Float_t ExtraModulePositionY() const;
+ Float_t PlasticLength() const;
+ Float_t PlasticWidth() const;
+ Float_t PlasticHeight() const;
+ Float_t ProfileWidth() const;
+ Float_t ProfileThickness() const;
Float_t Depth() const;
+ // constant to convert hits in digits
+ Float_t HitEnergyThreshold() const { return fgkHitEnergyThreshold;}
+ Float_t MaxHitTimeDifference() const { return fgkMaxHitTimeDifference;}
+ // constants for trigger
+ Int_t MultiMuonThreshold() const { return fgkMultiMuonThreshold;}
+ Float_t MultiMuonWindow() const { return fgkMultiMuonWindow;}
+
protected:
+
AliACORDEConstants();
- AliACORDEConstants(const AliACORDEConstants& ct);
- AliACORDEConstants& operator=(const AliACORDEConstants& ct);
static AliACORDEConstants* fgInstance; // static instanton
- static const Float_t fgkCageLenght; // Cage lenght
- static const Float_t fgkCageWidth; // Cage width
- static const Float_t fgkCageHeight; // Cage height
-
- static const Float_t fgkSinglePaletteLenght; // Palette lenght
- static const Float_t fgkSinglePaletteWidth; // Palette width
- static const Float_t fgkSinglePaletteHeight; // Palette height
-
- static const Float_t fgkActiveAreaGap; // Scintillator active area
+ static const Float_t fgkModuleLength; // Module lenght
+ static const Float_t fgkModuleWidth; // Module width
+ static const Float_t fgkModuleHeight; // Module height
+ static const Float_t fgkModulePositionX[60]; // position in ALICE
+ static const Float_t fgkModulePositionY[60]; // of center of module
+ static const Float_t fgkModulePositionZ[60];
+ static const Float_t fgkExtraModulePositionZ[4];
+ static const Float_t fgkExtraModulePositionX;
+ static const Float_t fgkExtraModulePositionY;
+
- static const Float_t fgkActiveAreaLenght; // Active area lenght
- static const Float_t fgkActiveAreaWidth; // Active area width
- static const Float_t fgkActiveAreaHeight; // Active area height
+ static const Float_t fgkPlasticLength; // Plastic length
+ static const Float_t fgkPlasticWidth; // Plastic width
+ static const Float_t fgkPlasticHeight; // Plastic height
- static const Float_t fgkMagnetWidth; // Magnet widht
- static const Float_t fgkMagnetLenght; // Magnet lenght
- static const Float_t fgkMagMinRadius; // Magnet inside radius
- static const Float_t fgkMagMaxRadius; // Magnet outer radius
+ static const Float_t fgkProfileWidth; // profile of the module
+ static const Float_t fgkProfileThickness;
static const Float_t fgkDepth; // Alice IP depth from surface
+ static const Float_t fgkHitEnergyThreshold;
+ static const Float_t fgkMaxHitTimeDifference;
+ static const Int_t fgkMultiMuonThreshold;
+ static const Float_t fgkMultiMuonWindow;
private:
ClassDef(AliACORDEConstants, 0) // ACORDE(ACORDE) global constants
};
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// class of Calibration for ACORDE Data Modules //
-// Pedro Gonzalez Zamora pedro.gonzalez@fcfm.buap.mx //
-// Irais Bautista Guzman irais@fcfm.buap.mx //
-// Arturo Fernandez Tellez afernan@cern.ch //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-
-
-#include "AliACORDEDataModule.h"
-
-ClassImp(AliACORDEDataModule)
-
-
-AliACORDEDataModule::AliACORDEDataModule():
-TNamed(),
-fRate(0x0),
-fStatus(kTRUE)
-{
- // Default constructor
-}
-
-//________________________________________________________________
-AliACORDEDataModule::AliACORDEDataModule(Float_t value,Bool_t status,const char* name):
-TNamed(),
-fRate(value),
-fStatus(status)
-{
-
-SetName(name);
-
-}
-
-//________________________________________________________________
-AliACORDEDataModule::~AliACORDEDataModule()
-{
- // Destructor
-}
-//__________________________________________________________________
-Float_t AliACORDEDataModule::GetRate()
-{
- return fRate;
-}
-//_________________________________________________________________
-Bool_t AliACORDEDataModule::GetStatus()
-{
-return fStatus;
-}
-void AliACORDEDataModule::SetRate(Float_t value)
-{
- fRate = value;
-}
-
+++ /dev/null
-#ifndef AliACORDEDataModule_H
-#define AliACORDEDataModule_H
-
-#include "TObject.h"
-#include "TNamed.h"
-
-
-
-class AliACORDEDataModule : public TNamed { //Set and get the name of the module
-
-public:
-
- AliACORDEDataModule();
- AliACORDEDataModule(Float_t value,Bool_t fStatus,const char* name);
- //AliACORDEDataModule(const AliACORDEDataModule & Data);
- //AliACORDEDataModule& operator=(const AliACORDEDataModule & Data);
- ~AliACORDEDataModule();
- Float_t GetRate(); //Get the rate value
- Bool_t GetStatus();//Get the Module status
- void SetRate(Float_t value); //Set the rate for modules
- void SetStatus(Bool_t status){fStatus=status;} // give the status 0 or 1 for modules
-
-
-
-
-private:
-
- Float_t fRate; //Module Rate
- Bool_t fStatus; //Module Status
-
-
-ClassDef(AliACORDEDataModule, 2);
-};
-#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
+
+///_________________________________________________________________________
+///
+/// This class constructs Digits out of Hits
+///
+///
+
+// --- Standard library ---
+
+// --- ROOT system ---
+#include <TMath.h>
+#include <TTree.h>
+#include <TRandom.h>
+
+// --- AliRoot header files ---
+#include "AliRun.h"
+#include "AliACORDE.h"
+#include "AliACORDEhit.h"
+#include "AliRunLoader.h"
+#include "AliLoader.h"
+#include "AliRunDigitizer.h"
+#include "AliCDBManager.h"
+#include "AliCDBStorage.h"
+#include "AliCDBEntry.h"
+#include "AliACORDECalibData.h"
+#include "AliACORDEConstants.h"
+
+#include "AliACORDEdigit.h"
+#include "AliACORDEDigitizer.h"
+
+ClassImp(AliACORDEDigitizer)
+
+AliACORDEDigitizer::AliACORDEDigitizer()
+ :AliDigitizer(),
+ fCalibData(GetCalibData()),
+ fNdigits(0),
+ fDigits(0)
+
+{
+ // default constructor
+}
+
+AliACORDEDigitizer::AliACORDEDigitizer(AliRunDigitizer* manager)
+ :AliDigitizer(manager),
+ fCalibData(GetCalibData()),
+ fNdigits(0),
+ fDigits(0)
+
+{
+ // constructor
+
+}
+
+AliACORDEDigitizer::~AliACORDEDigitizer()
+{
+ // destructor
+
+ if (fDigits) {
+ fDigits->Delete();
+ delete fDigits;
+ fDigits=0;
+ }
+}
+
+
+Bool_t AliACORDEDigitizer::Init()
+{
+ // Initialises the digitizer
+
+ // Initialises the Digit array
+ fDigits = new TClonesArray ("AliACORDEdigit", 1000);
+
+ return kTRUE;
+}
+
+void AliACORDEDigitizer::Exec(Option_t* /*option*/)
+{
+
+ // Creates digits from hits
+
+ // 1.- create and initialize temporal variables
+ // 2.- get loaders to access hots and digits
+ // 3.- loop over all input.
+ // 3.1 for each input loop over all track
+ // 3.2 for each track loop over all hits
+ // 3.3 for each hit, check
+ // if energy above threshold
+ // if survives efficiency
+ // then store the plastic, the time and track in temp arrays
+ // if a hit already survived for this plastic take the hit
+ // with the lowest time
+ // 4.- loop over temporal array
+ // if both plastic have a surviving hit and the time
+ // difference is below the limit, add a new digit
+ //
+
+
+ // 1.- temporal variables
+ Float_t emin = AliACORDEConstants::Instance()->HitEnergyThreshold();
+ Float_t td = AliACORDEConstants::Instance()->MaxHitTimeDifference();
+ Float_t PlasticTimes[2][60];
+ Int_t PlasticTracks[2][60];
+ for (Int_t i=0;i<60;i++) {
+ PlasticTimes[0][i]=-1.0;
+ PlasticTimes[1][i]=-1.0;
+ PlasticTracks[0][i]=-1;
+ PlasticTracks[1][i]=-1;
+ }
+
+
+ // 2.- get loaders
+ AliRunLoader* outRunLoader =
+ AliRunLoader::GetRunLoader(fManager->GetOutputFolderName());
+ if (!outRunLoader) {
+ Error("Exec", "Can not get output Run Loader");
+ return;}
+
+ AliLoader* outLoader = outRunLoader->GetLoader("ACORDELoader");
+ if (!outLoader) {
+ Error("Exec", "Can not get output ACORDE Loader");
+ return;}
+
+ outLoader->LoadDigits("update");
+ if (!outLoader->TreeD()) outLoader->MakeTree("D");
+ outLoader->MakeDigitsContainer();
+ TTree* treeD = outLoader->TreeD();
+ Int_t bufsize = 16000;
+ treeD->Branch("ACORDEdigit", &fDigits, bufsize);
+
+ // 3. loop over inputs
+ for (Int_t iInput = 0; iInput < fManager->GetNinputs(); iInput++) {
+ AliRunLoader* runLoader =
+ AliRunLoader::GetRunLoader(fManager->GetInputFolderName(iInput));
+ AliLoader* loader = runLoader->GetLoader("ACORDELoader");
+ if (!loader) {
+ Error("Exec", "Can not get ACORDE Loader for input %d", iInput);
+ continue;}
+
+ if (!runLoader->GetAliRun()) runLoader->LoadgAlice();
+
+ AliACORDE* acorde = (AliACORDE*) runLoader->GetAliRun()->GetDetector("ACORDE");
+ if (!acorde) {
+ Error("Exec", "No ACORDE detector for input %d", iInput);
+ continue;}
+
+ loader->LoadHits();
+ TTree* treeH = loader->TreeH();
+ if (!treeH) {
+ Error("Exec", "Cannot get TreeH for input %d", iInput);
+ continue; }
+
+ TClonesArray* hits = acorde->Hits();
+
+ // 3.1 loop over all tracks
+ Int_t nTracks = (Int_t) treeH->GetEntries();
+ for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
+ acorde->ResetHits();
+ treeH->GetEvent(iTrack);
+ Int_t nHits = hits->GetEntriesFast();
+ // 3.2 loop over hits
+ for (Int_t iHit = 0; iHit < nHits; iHit++) {
+ AliACORDEhit* hit = (AliACORDEhit *)hits->UncheckedAt(iHit);
+ // 3.3 select hit
+ // get hit info
+ Float_t eloss_mev = hit->Eloss()*1000.0;
+ Int_t module = hit->GetModule();
+ Int_t plastic = hit->GetPlastic();
+ Float_t time_ns = hit->GetTime()*1e9;
+ Float_t eff = TMath::Sqrt(fCalibData->GetEfficiency(module));
+
+ // if enough energy and efficiency
+ if( eloss_mev > emin && gRandom->Uniform() < eff ) {
+ // if first hit or earlier track
+ if ((PlasticTimes[plastic-1][module-1] == -1.0) ||
+ (PlasticTimes[plastic-1][module-1] > time_ns) ) {
+ PlasticTimes[plastic-1][module-1]= time_ns;
+ PlasticTracks[plastic-1][module-1]= hit->GetTrack();
+ }
+ }
+ } // end of hit loop
+ } // end of track loop
+
+ loader->UnloadHits();
+
+ } // end of input loop
+
+ // 4.- loop over temporal arrays to add hits
+
+ Int_t tracks[3]={-1,-1,-1};
+ for (Int_t i=0; i<60; i++) {
+ // if both modules have a hit
+ if (PlasticTimes[0][i] == -1) continue;
+ if (PlasticTimes[1][i] == -1) continue;
+ // if time diff small enough
+ Float_t diff = TMath::Abs(PlasticTimes[0][i]-PlasticTimes[1][i]);
+ if (diff < td) {
+ tracks[0] = PlasticTracks[0][i];
+ if (PlasticTracks[0][i] != PlasticTracks[1][i])
+ tracks[1] = PlasticTracks[1][i];
+ Int_t module = i+1;
+ Float_t module_time = (PlasticTimes[0][i] > PlasticTimes[1][i] ?
+ PlasticTimes[0][i] : PlasticTimes[1][i]);
+ AddDigit(tracks, module, module_time);
+ }
+ }
+
+ treeD->Fill();
+ outLoader->WriteDigits("OVERWRITE");
+ outLoader->UnloadDigits();
+ ResetDigit();
+}
+
+//____________________________________________________________________________
+
+void AliACORDEDigitizer::AddDigit(Int_t* track, Int_t module, Float_t time)
+{
+
+ // Adds Digit
+
+ TClonesArray &ldigits = *fDigits;
+ new(ldigits[fNdigits++]) AliACORDEdigit(track,module,time);
+}
+
+
+void AliACORDEDigitizer::ResetDigit()
+{
+//
+// Clears Digits
+//
+ fNdigits = 0;
+ if (fDigits) fDigits->Delete();
+}
+
+
+AliACORDECalibData* AliACORDEDigitizer::GetCalibData() const
+
+{
+ AliCDBManager *man = AliCDBManager::Instance();
+
+ AliCDBEntry *entry=0;
+
+ entry = man->Get("ACORDE/Calib/Data");
+
+ if(!entry){
+ AliWarning("Load of calibration data from default storage failed!");
+ AliWarning("Calibration data will be loaded from local storage ($ALICE_ROOT)");
+ Int_t runNumber = man->GetRun();
+ entry = man->GetStorage("local://$ALICE_ROOT")
+ ->Get("ACORDE/Calib/Data",runNumber);
+
+ }
+
+ // Retrieval of data in directory ACORDE/Calib/Data:
+
+
+ AliACORDECalibData *calibdata = 0;
+
+ if (entry) calibdata = (AliACORDECalibData*) entry->GetObject();
+ if (!calibdata) AliError("No calibration data from calibration database !");
+
+
+ return calibdata;
+
+}
+
--- /dev/null
+#ifndef ALIACORDEDigitizer_H
+#define ALIACORDEDigitizer_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+///_________________________________________________________________________
+///
+/// Class for making Digits in ACORDE
+///_________________________________________________________________________
+
+
+// --- Standard library ---
+
+// --- AliRoot header files ---
+
+#include "AliDigitizer.h"
+
+class TClonesArray;
+class AliRunDigitizer;
+class AliCDBManager;
+class AliCDBStorage;
+class AliACORDECalibData;
+
+class AliACORDEDigitizer: public AliDigitizer {
+
+ public:
+
+ AliACORDEDigitizer() ; // constructor
+ AliACORDEDigitizer(AliRunDigitizer *manager);// constructor
+ virtual ~AliACORDEDigitizer() ; // destructor
+
+ virtual Bool_t Init();
+ virtual void Exec(Option_t* option=0);
+
+ void AddDigit(Int_t* track, Int_t module, Float_t time);
+ void ResetDigit();
+
+ AliACORDECalibData *GetCalibData() const;
+
+ protected:
+
+ AliACORDECalibData *fCalibData; //! calibration data
+
+ private:
+
+ AliACORDEDigitizer(const AliACORDEDigitizer& /*digitizer*/);
+
+ AliACORDEDigitizer& operator = (const AliACORDEDigitizer& /*digitizer*/);
+
+
+ Int_t fNdigits; //! Number of digits
+ TClonesArray *fDigits; //! List of digits
+
+ ClassDef(AliACORDEDigitizer,1) // digitizer for ACORDE
+
+};
+
+#endif // AliACORDEDigitizer_H
--- /dev/null
+/////////////////////////////////////////////////////////////////////
+// //
+// Class AliACORDELoader //
+// //
+// Base class for ACORDELoaders. //
+// Loader provides base I/O facilities for standard data. //
+// Each detector has a loader data member. //
+// Loader is accessible via folder structure as well. //
+// //
+/////////////////////////////////////////////////////////////////////
+
+#include "AliACORDELoader.h"
+#include "AliLog.h"
+
+const TString AliACORDELoader::fgkDefaultHitsFileName= "ACORDE.Hits.root";
+const TString AliACORDELoader::fgkDefaultDigitsFileName= "ACORDE.Digits.root";
+
+ClassImp(AliACORDELoader)
+
+//_____________________________________________________________________________
+AliACORDELoader::AliACORDELoader()
+ {
+ // Default constructor
+ }
+
+//_____________________________________________________________________________
+AliACORDELoader::AliACORDELoader(const Char_t *name,const Char_t *topfoldername)
+ :AliLoader(name,topfoldername)
+{
+ AliDebug(1,Form("Name = %s; topfolder = %s",name,topfoldername));
+}
+
+//_____________________________________________________________________________
+AliACORDELoader::AliACORDELoader(const Char_t *name,TFolder *topfolder)
+ :AliLoader(name,topfolder)
+ {
+ }
--- /dev/null
+#ifndef ALIACORDELOADER_H
+#define ALIACORDELOADER_H
+
+/////////////////////////////////////////////////////////////////////
+// //
+// Base class for ACORDEloaders. //
+// Loader provides base I/O facilities for standard data. //
+// Each detector has a loader data member. //
+// Loader is always accessible via folder structure as well. //
+// //
+/////////////////////////////////////////////////////////////////////
+
+#include "AliLoader.h"
+
+class AliACORDELoader: public AliLoader
+ {
+ public:
+ AliACORDELoader();
+ AliACORDELoader(const Char_t *name,const Char_t *topfoldername);
+ AliACORDELoader(const Char_t *name,TFolder *topfolder);
+ virtual ~AliACORDELoader() {};
+
+ AliACORDELoader & operator = (const AliACORDELoader & ) {return *this;}
+
+ private:
+ static const TString fgkDefaultHitsFileName; // Default Name for hit file
+ static const TString fgkDefaultDigitsFileName;// Default Name for digit file
+
+ ClassDef(AliACORDELoader,1)
+
+ };
+
+#endif
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id: */
-
-////////////////////////////////////////////////////////////////////////////
-//
-// ALICE Cosmic Ray Trigger
-//
-// This class will provide the basic utilities to create the geometry of
-// the scintillatio array. This array is basically only the array
-// in the upper face of the magnet. The remaining arrays will be copies
-// of this array.
-//
-// Authors:
-//
-// Arturo Fernandez <afernand@fcfm.buap.mx>
-// Enrique Gamez <egamez@fcfm.buap.mx>
-//
-////////////////////////////////////////////////////////////////////////////
-
-#include "AliACORDEModule.h"
-
-ClassImp(AliACORDEModule)
-
-//_____________________________________________________________________________
-AliACORDEModule::AliACORDEModule()
- : TNamed(),
- fScintillatorThickness(0),
- fScintillatorWidth(0),
- fScintillatorLength(0),
- fFrameThickness(0),
- fFrameWidth(0),
- fFrameLength(0),
- fNColumns(0),
- fNRows(0),
- fZGap(0),
- fXGap(0)
-{
- //
- // Default constructor
- //
-}
-
-//_____________________________________________________________________________
-AliACORDEModule::AliACORDEModule(const char* name, const char* title)
- : TNamed(name, title),
- fScintillatorThickness(1),
- fScintillatorWidth(19.7),
- fScintillatorLength(186),
- fFrameThickness(10),
- fFrameWidth(26),
- fFrameLength(300),
- fNColumns(2),
- fNRows(10),
- fZGap(100),
- fXGap(0)
-{
- //
- // Standard constructor
- //
-}
-
-//_____________________________________________________________________________
-AliACORDEModule::AliACORDEModule(const AliACORDEModule& mod)
- : TNamed(mod),
- fScintillatorThickness(mod.fScintillatorThickness),
- fScintillatorWidth(mod.fScintillatorWidth),
- fScintillatorLength(mod.fScintillatorLength),
- fFrameThickness(mod.fFrameThickness),
- fFrameWidth(mod.fFrameWidth),
- fFrameLength(mod.fFrameLength),
- fNColumns(mod.fNColumns),
- fNRows(mod.fNRows),
- fZGap(mod.fZGap),
- fXGap(mod.fXGap)
-{
- //
- // Copy constructor
- //
-}
-
-//_____________________________________________________________________________
-AliACORDEModule::~AliACORDEModule()
-{
- //
- // Default destructor
- //
-}
-
-//_____________________________________________________________________________
-AliACORDEModule& AliACORDEModule::operator=(const AliACORDEModule& mod)
-{
- //
- // Asingment operator
- //
- fScintillatorThickness = mod.fScintillatorThickness;
- fScintillatorWidth = mod.fScintillatorWidth;
- fScintillatorLength = mod.fScintillatorLength;
- fFrameThickness = mod.fFrameThickness;
- fFrameWidth = mod.fFrameWidth;
- fFrameLength = mod.fFrameLength;
- fNColumns = mod.fNColumns;
- fNRows = mod.fNRows;
- fZGap = mod.fZGap;
- fXGap = mod.fXGap;
- return *this;
-}
+++ /dev/null
-#ifndef ALIACORDEMODULE_H
-#define ALIACORDEMODULE_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id: */
-/////////////////////////////////
-// ACORDE module geometry manager //
-/////////////////////////////////
-
-#include <TNamed.h>
-
-class AliACORDEModule : public TNamed {
-public:
- AliACORDEModule();
- AliACORDEModule(const char* name, const char* title);
- AliACORDEModule(const AliACORDEModule& mod);
- virtual ~AliACORDEModule();
-
- AliACORDEModule& operator=(const AliACORDEModule& mod);
-
- void SetScintillatorThickness(Float_t thickness);
- void SetScintillatorWidth(Float_t width);
- void SetScintillatorLenght(Float_t length);
-
- void SetFrameThickness(Float_t thickness);
- void SetFrameWidth(Float_t width);
- void SetFrameLength(Float_t length);
-
- void SetNumberOfColumns(Int_t ncols);
- void SetNumberOfRows(Int_t nrows);
-
- void SetZGap(Float_t zgap);
- void SetXGap(Float_t xgap);
-
- Float_t ScintillatorThickness() const;
- Float_t ScintillatorWidth() const;
- Float_t ScintillatorLenght() const;
-
- Float_t FrameThickness() const;
- Float_t FrameWidth() const;
- Float_t FrameLength() const;
-
- Int_t NumberOfModules() const;
- Int_t NumberOfColumns() const;
- Int_t NumberOfRows() const;
-
- Float_t ZGap() const;
- Float_t XGap() const;
-
-private:
- Float_t fScintillatorThickness; // Scintillator thickness
- Float_t fScintillatorWidth; // Scintillator width
- Float_t fScintillatorLength; // Scintillator length
- Float_t fFrameThickness; // Aluminium frame thickness
- Float_t fFrameWidth; // Aluminium frame width
- Float_t fFrameLength; // Aliuminium frame length
- Int_t fNColumns;//Number of modules per column per magnet face (z coordinate)
- Int_t fNRows; // Number of module rows per magnet face (x coordinate)
- Float_t fZGap; // Gap in Z betwen modules
- Float_t fXGap; // Gap in X betwen modules
- ClassDef(AliACORDEModule, 1)// ACORDE module geometry manager
-};
-
-typedef AliACORDEModule AliCRTModule; // for backward compatibility
-
-inline void AliACORDEModule::SetScintillatorThickness(Float_t thick)
-{ fScintillatorThickness = thick; }
-
-inline void AliACORDEModule::SetScintillatorWidth(Float_t width)
-{ fScintillatorWidth = width; }
-
-inline void AliACORDEModule::SetScintillatorLenght(Float_t length)
-{ fScintillatorLength = length; }
-
-inline void AliACORDEModule::SetFrameThickness(Float_t thick)
-{ fFrameThickness = thick; }
-
-inline void AliACORDEModule::SetFrameWidth(Float_t width)
-{ fFrameWidth = width; }
-
-inline void AliACORDEModule::SetFrameLength(Float_t length)
-{ fFrameLength = length; }
-
-inline void AliACORDEModule::SetNumberOfColumns(Int_t ncols)
-{ fNColumns = ncols; }
-
-inline void AliACORDEModule::SetNumberOfRows(Int_t nrows)
-{ fNRows = nrows; }
-
-inline void AliACORDEModule::SetZGap(Float_t zgap)
-{ fZGap = zgap; }
-
-inline void AliACORDEModule::SetXGap(Float_t xgap)
-{ fXGap = xgap; }
-
-inline Float_t AliACORDEModule::ScintillatorThickness() const
-{ return fScintillatorThickness; }
-
-inline Float_t AliACORDEModule::ScintillatorWidth() const
-{ return fScintillatorWidth; }
-
-inline Float_t AliACORDEModule::ScintillatorLenght() const
-{ return fScintillatorLength; }
-
-inline Float_t AliACORDEModule::FrameThickness() const
-{ return fFrameThickness; }
-
-inline Float_t AliACORDEModule::FrameWidth() const
-{ return fFrameWidth; }
-
-inline Float_t AliACORDEModule::FrameLength() const
-{ return fFrameLength; }
-
-inline Int_t AliACORDEModule::NumberOfModules() const
-{ return fNColumns*fNRows; }
-
-inline Int_t AliACORDEModule::NumberOfColumns() const
-{ return fNColumns; }
-
-inline Int_t AliACORDEModule::NumberOfRows() const
-{ return fNRows; }
-
-inline Float_t AliACORDEModule::ZGap() const
-{ return fZGap; }
-
-inline Float_t AliACORDEModule::XGap() const
-{ return fXGap; }
-#endif // ALIACORDEMODULE_H
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-
-
-#include "AliACORDEPreprocessor.h"
-#include "TRandom.h"
-#include "TFile.h"
-#include "AliCDBMetaData.h"
-#include "AliCDBEntry.h"
-#include "AliLog.h"
-#include "AliACORDECalibModule.h"
-#include "AliACORDEDataModule.h"
-
-#include <TTimeStamp.h>
-#include <TObjString.h>
-#include <TList.h>
-
-//
-// This is the first version of ACORDE Preprocessor
-// It takes data from DAQ and passes it to the class AliACORDECalibModule and
-// stores reference data.
-//
-// Authors
-// Pedro Gonzalez pedro.gonzalez@fcfm.buap.mx
-// Irais Bautista irais@fcfm.buap.mx
-// Arturo Fernandez Tellez afernan@cern.ch
-
-ClassImp(AliACORDEPreprocessor)
-
-//______________________________________________________________________________________________
-AliACORDEPreprocessor::AliACORDEPreprocessor(AliShuttleInterface* shuttle) :
- AliPreprocessor("ACO", shuttle),
- fCalData(0)
-{
- // constructor
-}
-
-//______________________________________________________________________________________________
-AliACORDEPreprocessor::~AliACORDEPreprocessor()
-{
- // destructor
-}
-
-//______________________________________________________________________________________________
-void AliACORDEPreprocessor::Initialize(Int_t run, UInt_t startTime,
- UInt_t endTime)
-{
- // Creates AliACORDECalibModule object
-
- AliPreprocessor::Initialize(run, startTime, endTime);
-
- Log(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
- TTimeStamp(startTime).AsString(),
- TTimeStamp(endTime).AsString()));
-
- fCalData = new AliACORDECalibModule();
-}
-
-//______________________________________________________________________________________________
-UInt_t AliACORDEPreprocessor::Process(TMap* /*dcsAliasMap*/)
-{
-
-
-
-
- TH1D *histoRate; //Histogram of the rates per module
- TFile *daqFile=0x0;
-
-
- // retrieve the run type from the Shuttle,
-
-
- TString runType = GetRunType();
-
- if(runType !="SPD_STANDALONE_CALIBRATION")
- {
-
- Log("RunType is not SPD_STANDALONE_CALIBRATION, nothing to do");
- return 1;
-
- }
-
-
- Log(Form("Run type for run %d: %s", fRun, runType.Data()));
-
-
-
- //retrieve the list of sources that produced the file with id RATES
-
- TList* sourceList = GetFileSources(kDAQ, "RATES");
-
- if (!sourceList)
- {
- Log("Error: No sources found for id RATES!");
- return 2;
- }
-
- // TODO We have the list of sources that produced the files with Id RATES
- // Now we will loop on the list and we'll query the files one by one.
-
-
-
- Log("The following sources produced files with the id RATES");
- sourceList->Print();
-
- TIter iter(sourceList);
- TObjString *source = 0;
-
-
-
- while((source=dynamic_cast<TObjString*> (iter.Next())))
- {
-
- TString fileName = GetFile(kDAQ, "RATES", source->GetName());
-
- if (fileName.Length() > 0)
- Log(Form("Got the file %s, now we can extract some values.", fileName.Data()));
-
- daqFile = new TFile(fileName.Data(),"READ");
- histoRate =(TH1D *) daqFile->Get("Rates"); //Get Histogram with Rates per module
-
-
- if(!histoRate)
- {
-
- Log(Form("There are not histos"));
- return 3;
-
- }
-
-
-
- //Set Status Module
- //Fills data in to AliACORDECalibModule object
-
- for(int module=0;module<kNModules;module++)
- {
-
- Float_t value = histoRate->At(module);
- TString name = "aco_hv_module";
-
- name+=module;
-
- //if(value>=0&&value<=2.5)
- fCalData->SetModule(module,value,1,name); //1 module
- // else
- // fCalData->SetModule(module,value,0,name); //0 module
-
-
- }
-
- fCalData->Create_Histo();
- //fCalData->Print_Module();
-}
-
-
- delete sourceList;
-
-
- //Now we have to store
-
- AliCDBMetaData metaData;
- metaData.SetBeamPeriod(0);
- metaData.SetResponsible("Pedro and Irais");
- metaData.SetComment("This preprocessor fills an AliACORDECalibModule object.");
-
- Bool_t result = StoreReferenceData("Calib", "Data",fCalData, &metaData);
-
- delete fCalData;
- fCalData = 0;
-
-
- if (!result)
- return 4;
-
- return 0;
-}
-
+++ /dev/null
-#ifndef ALI_ACORDE_PREPROCESSOR_H
-#define ALI_ACORDE_PREPROCESSOR_H
-
-#include "AliPreprocessor.h"
-
-// test preprocessor that writes data to AliACORDECalibModule
-
-class AliACORDECalibModule;
-
-class AliACORDEPreprocessor : public AliPreprocessor
-{
- public:
- enum{kNModules=60};
- AliACORDEPreprocessor(AliShuttleInterface* shuttle);
- virtual ~AliACORDEPreprocessor();
-
- protected:
- virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
- virtual UInt_t Process(TMap* dcsAliasMap);
- void CreateTableofReference();
- //virtual Bool_t ProcessDCS();
-
- private:
-
- AliACORDEPreprocessor(const AliACORDEPreprocessor &proc); //copy constructor
- AliACORDEPreprocessor& operator = (const AliACORDEPreprocessor & proc);
- AliACORDECalibModule *fCalData; // CDB class that stores the data
-
- ClassDef(AliACORDEPreprocessor, 0);
-};
-
-#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+///////////////////////////////////////////////////////////////////////////////
+// //
+// From ACORDE digits to Raw data
+//
+// there are 4 words of 32 bits corresponding to word 9 to 12
+// (words up to 8 correspond to the header)
+// Word 9: bits 1 to 30 --> Modules 1 to 30
+// bits 31-32 = '00'
+// Word 10: bits 1 to 30 --> Modules 31 to 60
+// bits 31-32 = '01'
+// Word 11: bits 1 to 30 --> Modules 1 to 30
+// bits 31-32 = '10'
+// Word 12: bits 1 to 30 --> Modules 1 to 30
+// bits 31-32 = '11'
+// Words 9 and 10 are the single muon trigger
+// Words 11 and 12 are the multi muon trigger
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "AliACORDERawData.h"
+#include "AliDAQ.h"
+#include "AliFstream.h"
+#include "AliRawDataHeader.h"
+
+
+ClassImp(AliACORDERawData)
+
+
+AliACORDERawData::AliACORDERawData()
+ :TObject(),
+ fWord9(0),
+ fWord10(0),
+ fWord11(0),
+ fWord12(0)
+{
+}
+
+AliACORDERawData::AliACORDERawData(const AliACORDERawData &r)
+ :TObject(),
+ fWord9(0),
+ fWord10(0),
+ fWord11(0),
+ fWord12(0)
+{
+ ((AliACORDERawData &) r).Copy(*this);
+}
+
+AliACORDERawData::~AliACORDERawData()
+
+{
+
+}
+
+AliACORDERawData &AliACORDERawData::operator=(const AliACORDERawData &r)
+
+{
+ if (this != &r) ((AliACORDERawData &) r).Copy(*this);
+ return *this;
+}
+
+void AliACORDERawData::WriteACORDERawData(Bool_t *b)
+
+{
+ // set words
+ SetACORDERawWords(b);
+
+ // open output file
+ const char *fileName = AliDAQ::DdlFileName("ACORDE",0);
+ AliFstream* fFile = new AliFstream(fileName);
+
+ // write header
+ AliRawDataHeader header;
+ UInt_t header_position = fFile->Tellp();
+ fFile->WriteBuffer((char*)(&header), sizeof(header));
+
+ // write digits
+ fFile->WriteBuffer((char*)(&fWord9), sizeof(fWord9));
+ fFile->WriteBuffer((char*)(&fWord10), sizeof(fWord10));
+ fFile->WriteBuffer((char*)(&fWord11), sizeof(fWord11));
+ fFile->WriteBuffer((char*)(&fWord12), sizeof(fWord12));
+
+ // write header again
+ UInt_t current_position = fFile->Tellp();
+ fFile->Seekp(header_position);
+ header.fSize = current_position-header_position;
+ header.SetAttribute(0); // valid data
+ fFile->WriteBuffer((char*)(&header), sizeof(header));
+ fFile->Seekp(current_position);
+}
+
+void AliACORDERawData::SetACORDERawWords(Bool_t *b)
+
+{
+ // set modules
+ for (Int_t i=0;i<30;i++) {
+ if (b[i]) {
+ fWord9|=(1<<i);
+ fWord11|=(1<<i);
+ }
+ if (b[i+30]) {
+ fWord10|=(1<<i);
+ fWord12|=(1<<i);
+ }
+ } // end for
+ // set labels
+ fWord10|=(1<<30);
+ fWord12|=(1<<30);
+ fWord11|=(1<<31);
+ fWord12|=(1<<31);
+}
--- /dev/null
+#ifndef ALIACORDERAWDATA_H
+#define ALIACORDERAWDATA_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Converts T0 digits into a raw data stream //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+#include "TObject.h"
+
+class AliACORDERawData : public TObject {
+
+ public:
+
+ AliACORDERawData();
+ AliACORDERawData(const AliACORDERawData &r);
+ virtual ~AliACORDERawData();
+ AliACORDERawData &operator=(const AliACORDERawData &r); // ass. op.
+
+ void WriteACORDERawData(Bool_t *b);
+ void SetACORDERawWords(Bool_t *b);
+
+
+ private:
+
+ UInt_t fWord9;
+ UInt_t fWord10;
+ UInt_t fWord11;
+ UInt_t fWord12;
+
+ ClassDef(AliACORDERawData,1) // T0 raw data class
+
+};
+
+typedef AliACORDERawData AliCRTRawData; // for backward compatibility
+
+#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+#include "Riostream.h"
+
+#include <TClonesArray.h>
+#include "AliRun.h"
+#include "AliRunLoader.h"
+#include "AliACORDETrigger.h"
+#include "AliACORDEConstants.h"
+
+//______________________________________________________________________
+ClassImp(AliACORDETrigger)
+
+AliACORDETrigger::AliACORDETrigger()
+ :AliTriggerDetector(),
+ fSingleMuon(0),
+ fMultiMuon(0)
+{
+
+ cout << " ================>>>>>>>>>>>>>>>>> AliACORDETrigger" << endl;
+ SetName("ACORDE");
+ CreateInputs();
+ for (Int_t i=0; i<60; i++) fModuleFired[i]=kFALSE;
+}
+
+void AliACORDETrigger::CreateInputs()
+{
+ // Do not create inputs again!!
+ if( fInputs.GetEntriesFast() > 0 ) return;
+
+ // two acorde triggers, single muon and multicoincidence
+ fInputs.AddLast( new
+ AliTriggerInput( "ACORDE_SINGLE",
+ "At least one digit in ACORDE", 0x01 ) );
+ fInputs.AddLast( new
+ AliTriggerInput( "ACORDE_MULTI",
+ "At least M digits in ACORDE", 0x02 ) );
+}
+
+void AliACORDETrigger::Trigger()
+{
+
+ // 1.- Get loaders and pointers
+ // 2.- Loop over all entries
+ // set temporal variables to default values
+ // start the loop
+ // 3.- Loop over all digits in an entrie
+ // Fill temporal arrays
+ // Find module with lowest time
+ // 4.- Loop over temporal arrays
+ // Find number of modules within the time window
+ // 5.- Set the relevant trigger
+
+ // 1.- Get loaders and pointers
+ AliRunLoader* runLoader = gAlice->GetRunLoader();
+ AliACORDELoader* loader =
+ (AliACORDELoader* )runLoader->GetLoader( "ACORDELoader" );
+ loader->LoadDigits("READ");
+ TTree* acordeDigitsTree = loader->TreeD();
+ if (!acordeDigitsTree) return;
+ TClonesArray* acordeDigits = new TClonesArray("AliACORDEdigit",1000);
+ TBranch* digitBranch = acordeDigitsTree->GetBranch("ACORDEdigit");
+ digitBranch->SetAddress(&acordeDigits);
+
+ // 2.- Loop over all entries
+ // set temporal variables to default values
+
+ Int_t MultiMin = AliACORDEConstants::Instance()->MultiMuonThreshold();
+ Float_t time_window = AliACORDEConstants::Instance()->MultiMuonWindow();
+ Int_t MinTimeModule = -1;
+ Float_t MinTime = 1e10;
+ Float_t ModuleTimes[60];
+ for (Int_t i=0; i<60; i++) ModuleTimes[i] = -1.0;
+
+ // start the loop
+ Int_t nEntries = (Int_t)acordeDigitsTree->GetEntries();
+ cout << " ===AliACORDETrigger=== nEntries " <<nEntries << endl;
+ for (Int_t e=0; e<nEntries; e++) {
+ acordeDigitsTree->GetEvent(e);
+ // 3.- Loop over all digits in an entrie
+ // Fill temporal arrays
+ // Find module with lowest time
+ Int_t nDigits = acordeDigits->GetEntriesFast();
+ cout << " ===AliACORDETrigger=== nDigits " <<nDigits << endl;
+ for (Int_t d=0; d<nDigits; d++) {
+ AliACORDEdigit* digit = (AliACORDEdigit*)acordeDigits->At(d);
+ Int_t module = digit->GetModule();
+ Float_t mod_time = digit->GetTime();
+ ModuleTimes[module-1]=mod_time;
+ if (mod_time < MinTime) {
+ MinTime = mod_time;
+ MinTimeModule = module;
+ }
+ } // end of loop over digits
+ } // end of loop over events in digits tree
+
+ // 4.- Loop over temporal arrays
+ // Find number of modules within the time window
+ if (MinTimeModule == -1) return;
+ for (Int_t i=0; i<60; i++) {
+ if (ModuleTimes[i]<0) continue;
+ Float_t diff = ModuleTimes[i]-MinTime;
+ if (diff<time_window) {
+ fMultiMuon++;
+ fModuleFired[i]=kTRUE;
+ }
+ }
+ cout << " fSingleMuon " << fSingleMuon
+ << " MinTime " << MinTime
+ << " fMultiMuon " << fMultiMuon << endl;
+ // 5.- Set the relevant trigger
+ fSingleMuon = MinTimeModule;
+ SetInput( "ACORDE_SINGLE" );
+ if (fMultiMuon>=MultiMin) SetInput( "ACORDE_MULTI" );
+ return;
+}
--- /dev/null
+#ifndef ALIACORDETrigger_H
+#define ALIACORDETrigger_H
+
+///_________________________________________________________________________
+///
+/// Class for making ACORDE Trigger
+///_________________________________________________________________________
+
+
+#include "AliTriggerDetector.h"
+#include "AliTriggerInput.h"
+
+#include "AliACORDELoader.h"
+#include "AliACORDEdigit.h"
+
+#include "AliLog.h"
+
+
+class AliACORDETrigger : public AliTriggerDetector
+{
+ public:
+ AliACORDETrigger(); // constructor
+ virtual ~AliACORDETrigger(){} // destructor
+ virtual void CreateInputs();
+ virtual void Trigger();
+
+ virtual Int_t GetSingleMuon() const {return fSingleMuon;}
+ virtual Int_t GetMultiMuon() const {return fMultiMuon;}
+ virtual Bool_t GetModuleFired(Int_t i) const {return fModuleFired[i-1];}
+
+private:
+
+ Int_t fSingleMuon; // number of module firing the Single Muon trigger
+ Int_t fMultiMuon; // number of modules firing for the Multi Muon trigger
+ Bool_t fModuleFired[60]; // modules which have fired
+
+ ClassDef( AliACORDETrigger, 1 ) // ACORDE Trigger Detector class
+};
+
+#endif // AliACORDETrigger_H
/* $Id$ */
-////////////////////////////////////////////////////////////////////////////
-// ACORDE digit: Id
-//
-// The digits are made in FinishEvent() by summing all the hits in a
-// counter.
-// The main parts of the code need to be written.
-//
-////////////////////////////////////////////////////////////////////////////
#include "AliACORDEdigit.h"
-#include <TArrayF.h>
-#include <TArrayI.h>
-
ClassImp(AliACORDEdigit)
//_____________________________________________________________________________
AliACORDEdigit::AliACORDEdigit()
: AliDigit(),
- fSector(0),
- fPlate(0),
- fStrip(0),
- fPadx(0),
- fPadz(0),
- fNDigits(0),
- fTdc(0),
- fAdc(0)
+ fModule(0),
+ fTime(0)
{
//
// Default constructor
}
//_____________________________________________________________________________
-AliACORDEdigit::AliACORDEdigit(Int_t* tracks, Int_t *vol, Float_t *digit)
+AliACORDEdigit::AliACORDEdigit(Int_t* tracks, Int_t module, Float_t pulse_time)
: AliDigit(tracks),
- fSector(vol[0]),
- fPlate(vol[1]),
- fStrip(vol[2]),
- fPadx(vol[3]),
- fPadz(vol[4]),
- fNDigits(1),
- fTdc(new TArrayF(fNDigits)),
- fAdc(new TArrayF(fNDigits))
+ fModule(module),
+ fTime(pulse_time)
{
-
- //
- // Creates ACORDE digit
- // The creator for the AliACORDEdigit class. This routine fills the
- // AliACORDEdigit data members from the array digits.
- //
- (*fTdc)[0] = digit[0];
- (*fAdc)[0] = digit[1];
-}
-//_____________________________________________________________________________
-AliACORDEdigit::AliACORDEdigit(const AliACORDEdigit& digit)
- : AliDigit(digit),
- fSector(digit.fSector),
- fPlate(digit.fPlate),
- fStrip(digit.fStrip),
- fPadx(digit.fPadx),
- fPadz(digit.fPadz),
- fNDigits(digit.fNDigits),
- fTdc(digit.fTdc),
- fAdc(digit.fAdc)
-{
- //
- //-- Copy constructor
- //
}
//_____________________________________________________________________________
//
//
//
- if ( fAdc ) { delete fAdc; fAdc = 0; }
- if ( fTdc ) { delete fTdc; fTdc = 0; }
}
-//_____________________________________________________________________________
-AliACORDEdigit& AliACORDEdigit::operator=(const AliACORDEdigit& digit)
-{
- //
- //-- Asingment operator.
- //
- fSector = digit.fSector;
- fPlate = digit.fPlate;
- fStrip = digit.fStrip;
- fPadx = digit.fPadx;
- fPadz = digit.fPadz;
- fNDigits = digit.fNDigits;
- fTdc = digit.fTdc;
- fAdc = digit.fAdc;
- return *this;
-}
#include "AliDigit.h"
-class TArrayF;
-class TArrayI;
-
class AliACORDEdigit: public AliDigit {
-public:
+
+ public:
AliACORDEdigit();
- AliACORDEdigit(Int_t* tracks, Int_t* vol, Float_t* digit);
- AliACORDEdigit(const AliACORDEdigit& digit);
+ AliACORDEdigit(Int_t* tracks, Int_t module, Float_t pulse_time);
virtual ~AliACORDEdigit();
- AliACORDEdigit& operator= (const AliACORDEdigit& digit);
-
-protected:
- Int_t fSector; // number of sector
- Int_t fPlate; // number of plate
- Int_t fStrip; // number of strip
- Int_t fPadx; // number of pad along x
- Int_t fPadz; // number of pad along z
- Int_t fNDigits; // dimension of fTdc array
- TArrayF* fTdc; // tdc values for sdigit
- TArrayF* fAdc; // adc values for sdigit
+ Int_t GetModule() const { return fModule;}
+ Float_t GetTime() const { return fTime;}
+
private:
- ClassDef(AliACORDEdigit,1) //Digit (Header) object for set : ACORDE (ACORDE)
+ Int_t fModule; // module producing the digit (1-60)
+ Float_t fTime; // time of the start of the square pulse
+
+
+ ClassDef(AliACORDEdigit,1) //Digit (Header) object for set : ACORDE (ACORDE)
+
};
typedef AliACORDEdigit AliCRTdigit; // for backward compatibility
/* $Id$ */
+// volume:
+// [0] = module number 1-60 (1==>(0-0), 60 (5-9)
+// [1] = Plastic number: 0 (down) to 1 (up)
+//
+// hit
+// [0] = PID
+// [1-3] = x, y, z
+// [4] = time
+// [5-7] = px, py, pz
+// [8] = energy
+// [9] = energy loss
+// [10] = trak length in plastic
+
#include "AliACORDEhit.h"
#include <TMath.h>
//____________________________________________________________________________
AliACORDEhit::AliACORDEhit()
: AliHit(),
- fId(0),
+ fModule(0),
+ fPlastic(0),
+ fTrackId(0),
+ fTime(0),
fPx(0),
fPy(0),
fPz(0),
fEloss(0),
- fMedium(0)
+ fEnergy(0),
+ fTrkLength(0)
{
//
// default ctor for AliACORDEhit object
//_____________________________________________________________________________
AliACORDEhit::AliACORDEhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits)
: AliHit(shunt, track),
- fId(hits[0]),
- fPx(hits[4]),
- fPy(hits[5]),
- fPz(hits[6]),
- fEloss(hits[7]),
- fMedium(vol[0])
+ fModule(vol[0]),
+ fPlastic(vol[1]),
+ fTrackId((Int_t) hits[0]),
+ fTime(hits[4]),
+ fPx(hits[5]),
+ fPy(hits[6]),
+ fPz(hits[7]),
+ fEloss(hits[9]),
+ fEnergy(hits[8]),
+ fTrkLength(hits[10])
{
//
// Constructor of hit object
fZ = hits[3];
}
-//____________________________________________________________________________
-AliACORDEhit::AliACORDEhit(const AliACORDEhit & hit)
- : AliHit(hit),
- fId(hit.fId),
- fPx(hit.fPx),
- fPy(hit.fPy),
- fPz(hit.fPz),
- fEloss(hit.fEloss),
- fMedium(hit.fMedium)
-{
- //
- // copy ctor
- //
- fX = hit.fX;
- fY = hit.fY;
- fZ = hit.fZ;
-}
//_____________________________________________________________________________
AliACORDEhit::~AliACORDEhit()
//
}
-//_____________________________________________________________________________
-AliACORDEhit& AliACORDEhit::operator=(const AliACORDEhit & hit)
-{
- //
- // aisngment operator.
- //
- fId = hit.fId;
- fX = hit.fX;
- fY = hit.fY;
- fZ = hit.fZ;
- fPx = hit.fPx;
- fPy = hit.fPy;
- fPz = hit.fPz;
- fEloss = hit.fEloss;
- fMedium = hit.fMedium;
- return *this;
-}
-
-//_____________________________________________________________________________
-Float_t AliACORDEhit::Energy() const
-{
- //
- //
- //
- return TMath::Sqrt(fPx*fPx + fPy*fPy + fPz*fPz);
-}
//_____________________________________________________________________________
Float_t AliACORDEhit::PolarAngle() const
//
//
//
- return kRaddeg*TMath::ACos(-fPy/this->Energy());
+ // return kRaddeg*TMath::ACos(-fPy/this->Energy());
+ return kRaddeg*TMath::ACos(fPz/this->Energy());
}
//_____________________________________________________________________________
//
//
//
- return kRaddeg*TMath::ATan2(-fPx, -fPz);
-}
-
-//_____________________________________________________________________________
-Bool_t AliACORDEhit::operator==(const AliACORDEhit& hit)
-{
- //
- //
- //
- Float_t energy = TMath::Sqrt(fPx*fPx + fPy*fPy + fPz*fPz);
- Float_t energy2=TMath::Sqrt(hit.fPx*hit.fPx+hit.fPy*hit.fPy+hit.fPz*hit.fPz);
- return (energy == energy2);
- //return (fTrack == hit.fTrack);
-}
-
-//_____________________________________________________________________________
-Bool_t AliACORDEhit::operator<(const AliACORDEhit& hit)
-{
- //
- //
- //
- Float_t energy = TMath::Sqrt(fPx*fPx + fPy*fPy + fPz*fPz);
- Float_t energy2=TMath::Sqrt(hit.fPx*hit.fPx+hit.fPy*hit.fPy+hit.fPz*hit.fPz);
- return (energy < energy2);
+ // return kRaddeg*TMath::ATan2(-fPx, -fPz);
+ return kRaddeg*TMath::ATan2(fPx, fPz);
}
public:
AliACORDEhit();
AliACORDEhit(Int_t shunt, Int_t track, Int_t* vol, Float_t *hits);
- AliACORDEhit(const AliACORDEhit& hit);
virtual ~AliACORDEhit();
- AliACORDEhit& operator=(const AliACORDEhit& hit);
- Bool_t operator==(const AliACORDEhit& hit);
- Bool_t operator<(const AliACORDEhit& hit);
+ Int_t GetModule() const {return fModule;}
+ Int_t GetPlastic() const {return fPlastic;}
- Float_t ParticleId() const {return fId;}
+ Float_t TrackId() const {return fTrackId;}
+ Float_t GetTime() const {return fTime;}
Float_t Px() const {return fPx;}
Float_t Py() const {return fPy;}
Float_t Pz() const {return fPz;}
+ Float_t Energy() const {return fEnergy;}
Float_t Eloss() const {return fEloss;}
- Float_t Medium() const {return fMedium;}
- Float_t Energy() const;
Float_t PolarAngle() const;
Float_t AzimuthAngle() const;
+ Float_t TrkLength() const {return fTrkLength;}
+
protected:
- Float_t fId; //
- Float_t fPx; //
- Float_t fPy; //
- Float_t fPz; //
- Float_t fEloss; //
- Float_t fMedium; //
+ Int_t fModule;
+ Int_t fPlastic;
+ Float_t fTrackId;
+ Float_t fTime;
+ Float_t fPx;
+ Float_t fPy;
+ Float_t fPz;
+ Float_t fEloss;
+ Float_t fEnergy;
+ Float_t fTrkLength;
private:
ClassDef(AliACORDEhit,1) // Hit for ACORDE (ACORDE)
// ALICE Cosmic Ray Trigger //
// //
// This class contains the functions for version 0 of the ALICE Cosmic Ray //
-// Trigger. This version will be used to simulation comic rays in alice //
-// with all the detectors. //
-//
-// Authors:
-//
-// Arturo Fernandez <afernand@fcfm.buap.mx>
-// Enrique Gamez <egamez@fcfm.buap.mx>
-//
-// Universidad Autonoma de Puebla
-//
-//
-//Begin_Html
-/*
-<img src="picts/AliACORDEv0Class.gif">
-</pre>
-<br clear=left>
-<p>The responsible person for this module is
-<a href="mailto:egamez@fcfm.buap.mx">Enrique Gamez</a>.
-</font>
-<pre>
-*/
-//End_Html
+// Trigger. This version will be used to simulation comic rays in alice with//
+// all the detectors. It include geometry and hits (posicion and momentum) //
// //
+// Send comments to: //
+// Arturo Fernandez <afernand@fcfm.buap.mx> //
+// Enrique Gamez <egamez@fcfm.buap.mx> //
+// Eleazar Cuautle <ecuautle@nucleares.unam.mx> //
///////////////////////////////////////////////////////////////////////////////
-#include "AliACORDEv0.h"
+#include "AliACORDEv0.h"
+#include <TClonesArray.h>
+#include <TLorentzVector.h>
+#include <TVirtualMC.h>
+#include <TPDGCode.h>
#include <TGeometry.h>
#include <TBRIK.h>
#include <TNode.h>
-#include <TVirtualMC.h>
+
#include "AliRun.h"
#include "AliConst.h"
-
+#include "AliACORDEhit.h"
#include "AliACORDEConstants.h"
-#include "AliACORDEModule.h"
+#include "AliMC.h"
+#include "AliLog.h"
ClassImp(AliACORDEv0)
{
//
// Default constructor
+ fIshunt = 0;
+ fHits = 0;
//
-}
-
+}
//_____________________________________________________________________________
AliACORDEv0::AliACORDEv0(const char *name, const char *title)
: AliACORDE(name, title)
//
// Standard constructor
//
- //Begin_Html
- /*
- <img src="picts/AliACORDEv0.gif">
- */
- //End_Html
- //PH SetMarkerColor(kRed);
- //PH SetMarkerStyle(kRed);
- //PH SetMarkerSize(0.4);
+ fIshunt = 1; // All hits are associated with primary particles
+ fHits = new TClonesArray("AliACORDEhit",400);
+ gAlice->GetMCApp()->AddHitList(fHits);
}
-
//_____________________________________________________________________________
AliACORDEv0::~AliACORDEv0()
{
// Default destructor
//
}
-
//_____________________________________________________________________________
void AliACORDEv0::BuildGeometry()
{
+
+ // not needed anymore
+
+}
+
+//_____________________________________________________________________________
+void AliACORDEv0::CreateGeometry()
+{
+ CreateAcorde();
+ if (GetCreateCavern()) CreateCavern();
+}
+
+void AliACORDEv0::CreateCavern()
+{
+ Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
+ // Create the mother volume, the one which will contain all the material
+ // above the hall.
+ Float_t pbox[3];
+ pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
+ //pbox[0] = 12073;
+ pbox[1] = AliACORDEConstants::Instance()->Depth();
+ pbox[2] = pbox[0];
+ gMC->Gsvolu("ACORDE", "BOX", idtmed[1114], pbox, 3);
+ gMC->Gspos("ACORDE", 1, "ALIC", 0, 0, 0, 0, "ONLY");
+ CreateShafts();
+ CreateMolasse();
+}
+
+void AliACORDEv0::CreateShafts()
+
+{
+
+ //
+ Int_t idrotm[2499]; // The rotation matrix.
+ Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
+
//
- // Create the ROOT TNode geometry for the ACORDE
+ // Acces shafts
//
+ AliMatrix(idrotm[2001], 0, 0, 90, 0, 90, 90);
+
+
+ // Create a bing cilinder to hold the main structures in the shaft.
+ // All the structures relative to the shaft will be put into
+ // this volume.
+ // This shaft is composed by an open tube down in the hall, and
+ // a cilinder avobe the level of the ceiling.
+ Float_t ptube[3];
+ ptube[0] = 0; // inner radius
+ ptube[1] = 1250; // outer radius
+ ptube[2] = 5150/2; // Half lenght in Z
+ gMC->Gsvolu("CSF1", "TUBE", idtmed[1114], ptube, 3);
+
+ Float_t ptubs[5];
+ // The open section of the PX24
+ ptubs[0] = 1150; // Inner radius
+ ptubs[1] = 1250; // Outer radius
+ ptubs[2] = 1300; // Half length
+ ptubs[3] = 180 + kRaddeg*TMath::ASin(1070/ptubs[0]); // starting angle
+ ptubs[4] = 180 - kRaddeg*TMath::ASin(1070/ptubs[0]);
+ gMC->Gsvolu("CSF2", "TUBS", idtmed[1116], ptubs, 5);
+ gMC->Gspos("CSF2", 1, "CSF1", 0, 0, -ptube[2] + ptubs[2], 0, "MANY");
+
+ // The other part of the shaft.
+ ptube[0] = ptubs[0]; // Inner radius
+ ptube[1] = ptubs[1]; // Outer radius
+ ptube[2] = 5150/2 - ptubs[2]; // Half lenght
+ gMC->Gsvolu("CSF3", "TUBE", idtmed[1116], ptube, 3);
+ gMC->Gspos("CSF3", 1, "CSF1", 0, 0, 5150/2 - ptube[2], 0, "MANY");
+
+ Float_t pbox[3];
+ // Concrete walls along the shaft (next to the elevator.)
+ pbox[0] = 480/2; // Half length in X
+ pbox[1] = 120/2; // Half length in Y
+ pbox[2] = 5150/2; // Half length in Z
+ gMC->Gsvolu("CSW1", "BOX", idtmed[1116], pbox, 3);
+ gMC->Gspos("CSW1", 1, "CSF1", 820+pbox[0], 150+pbox[1], 0, 0, "MANY");
+ gMC->Gspos("CSW1", 2, "CSF1", 820+pbox[0], -300-pbox[1], 0, 0, "MANY");
- TNode *node, *top;
+ //
+ pbox[0] = 120/2; // Half length in X
+ pbox[1] = 750/2; // Half length in Y
+ pbox[2] = 5150/2; // Half length in Z
+ gMC->Gsvolu("CSW2", "BOX", idtmed[1116], pbox, 3);
+ gMC->Gspos("CSW2", 1, "CSF1", 820-60, 150+pbox[1], 0, 0, "MANY");
- const Int_t kColorACORDE = kRed;
+ //
+ pbox[0] = 120/2; // Half length in X
+ pbox[1] = 600/2; // Half lenght in Y
+ pbox[2] = 5150/2; // Half length in Z
+ gMC->Gsvolu("CSW3", "BOX", idtmed[1116], pbox, 3);
+ gMC->Gspos("CSW3", 1, "CSF1", 820-60, -300-pbox[1], 0, 0, "MANY");
+
+ // Material below the counting rooms.
+ pbox[0] = 400/2;
+ pbox[1] = 2300/2;
+ pbox[2] = 300/2;
+ gMC->Gsvolu("CSW4", "BOX", idtmed[1116], pbox, 3);
+ gMC->Gspos("CSW4",1,"CSF1",2300/2-pbox[0],0,3000-5150/2-pbox[2], 0, "MANY");
+
+ // Shielding plug.
+ pbox[0] = 1400/2;
+ pbox[1] = 2300/2;
+ pbox[2] = 170/2;
+ gMC->Gsvolu("CSW5", "BOX", idtmed[1116], pbox, 3);
+ gMC->Gspos("CSW5", 1, "CSF1", 0, 0, 3000-5150/2-130, 0, "MANY");
+
+ // The end of the support for the shielding plug.
+ pbox[0] = 170/2;
+ pbox[1] = 2300/2;
+ pbox[2] = 300/2;
+ gMC->Gsvolu("CSW6", "BOX", idtmed[1116], pbox, 3);
+ gMC->Gspos("CSW6",1,"CSF1",-1400/2-pbox[0],0,3000-5150/2-pbox[2],0,"MANY");
+
+ // ...
+ pbox[0] = 100/2;
+ pbox[1] = 2300/2;
+ pbox[2] = 450/2;
+ gMC->Gsvolu("CSW7", "BOX", idtmed[1116], pbox, 3);
+ gMC->Gspos("CSW7",1,"CSF1",-1400/2-170-pbox[0],0,3000-5150/2+pbox[2],0,"MANY");
+
+ // Material close to the pipe.
+ pbox[0] = 300/2;
+ pbox[1] = 2300/2;
+ pbox[2] = 170/2;
+ gMC->Gsvolu("CSW8", "BOX", idtmed[1116], pbox, 3);
+ gMC->Gspos("CSW8",1,"CSF1",-2300/2+pbox[0],0,2500-5150/2,0,"MANY");
+
+ // Now put the shaft into the mother volume.
+ gMC->Gspos("CSF1", 1, "ACORDE", 0, AliACORDEConstants::Instance()->Depth() - 5150/2, 2300, idrotm[2001], "MANY");
+
+ // PM25 Access Shaft
+ ptube[0] = 910/2;
+ ptube[1] = ptube[0] + 100;
+ ptube[2] = (5150 - 1166)/2;
+ gMC->Gsvolu("CSF4", "TUBE", idtmed[1116], ptube, 3);
+ gMC->Gspos("CSF4", 1, "ACORDE", 2100, AliACORDEConstants::Instance()->Depth()-ptube[2], 0, idrotm[2001], "MANY");
+
+ // PGC2 Access Shaft
+ ptube[0] = 1100/2;
+ ptube[1] = ptube[0] + 100;
+ ptube[2] = (5150 - 690)/2;
+ gMC->Gsvolu("CSF5", "TUBE", idtmed[1116], ptube, 3);
+ gMC->Gspos("CSF5", 1, "ACORDE", -375, AliACORDEConstants::Instance()->Depth()-ptube[2], -1900 - 2987.7, idrotm[2001], "MANY");
- // Find the top node alice.
- top = gAlice->GetGeometry()->GetNode("alice");
+}
- AliACORDEConstants* crtConstants = AliACORDEConstants::Instance();
- new TBRIK("S_ACORDE_A", "ACORDE box", "void",
- crtConstants->ActiveAreaLenght()/2.,
- crtConstants->ActiveAreaHeight()/2.,
- crtConstants->ActiveAreaWidth()/2.);
+void AliACORDEv0::CreateMolasse()
-
- new TRotMatrix("Left", "Left", 90., 315., 90., 45., 0., 337.5);
- new TRotMatrix("Right", "Right", 90., 45., 90., 315., 180., 202.5);
- new TRotMatrix("Up", "Up", 90., 0., 90., 90., 0., 90.);
- top->cd();
+{
//
- // Put 4 modules on the top of the magnet
- Float_t box = crtConstants->CageWidth()/2.;
- top->cd();
- node = new TNode("upper1", "upper1", "S_ACORDE_A", 0., 790., 3.*box, "Up");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
- top->cd();
- node = new TNode("upper2", "upper2", "S_ACORDE_A", 0., 790., box, "Up");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
- top->cd();
- node = new TNode("upper3", "upper3", "S_ACORDE_A", 0., 790., -1.*box, "Up");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
- top->cd();
- node = new TNode("upper4", "upper4", "S_ACORDE_A", 0., 790., -3.*box, "Up");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
-
- // Modules on the left side.
- Float_t xtragap = 10.;
- Float_t initXside = (790.+xtragap)*TMath::Sin(2*22.5*kDegrad); //rigth side
- Float_t initYside = (790.+xtragap)*TMath::Cos(2*22.5*kDegrad);
- top->cd();
- node = new TNode("upper5", "upper5", "S_ACORDE_A", initXside, initYside, 3.*box, "Left");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
- top->cd();
- node = new TNode("upper6", "upper6", "S_ACORDE_A", initXside, initYside, box, "Left");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
- top->cd();
- node = new TNode("upper7", "upper7", "S_ACORDE_A", initXside, initYside, -1.*box, "Left");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
- top->cd();
- node = new TNode("upper8", "upper8", "S_ACORDE_A", initXside, initYside, -3.*box, "Left");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
-
- // Modules on the right side.
- top->cd();
- node = new TNode("upper9", "upper9", "S_ACORDE_A", -initXside, initYside, 3.*box, "Right");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
- top->cd();
- node = new TNode("upper10", "upper10", "S_ACORDE_A", -initXside, initYside, box, "Right");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
- top->cd();
- node = new TNode("upper11","upper11", "S_ACORDE_A", -initXside, initYside, -1.*box, "Right");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
-
- top->cd();
- node = new TNode("upper12","upper12", "S_ACORDE_A", -initXside, initYside, -3.*box, "Right");
- node->SetLineColor(kColorACORDE);
- fNodes->Add(node);
+ Int_t idrotm[2499]; // The rotation matrix.
+ Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
+
+ Float_t px24radius = 2300/2;
+ Float_t px24X = 0;
+ //Float_t px24Y = ;
+ Float_t px24Z = 2300;
+
+ Float_t pm25radius = 910/2;
+ Float_t pm25X = 2100;
+ //Float_t pm25Y = ;
+ Float_t pm25Z = 0;
+
+ Float_t pgc2radius = 1100/2;
+ Float_t pgc2X = -375;
+ //Float_t pgc2Y = ;
+ Float_t pgc2Z = -(1900 + 2987.7);
+
+ Float_t concreteWidth = 100; // Standard width of the hall walls.
+
+
+ // Create a local mother volume.
+ Float_t pbox[3];
+ pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
+ pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
+ pbox[2] = pbox[0];
+ gMC->Gsvolu("CMO1", "BOX", idtmed[1114], pbox, 3);
+
+ // Now put the molasse exactly above the hall. OK
+ // Above the ceiling
+ Float_t ptubs[5];
+ ptubs[0] = 1170;
+ ptubs[1] = 2100 - pm25radius;
+ ptubs[2] = 1900/2 + px24radius;
+ ptubs[3] = 0;
+ ptubs[4] = 180;
+ gMC->Gsvolu("CMO2", "TUBS", idtmed[1123], ptubs, 5);
+ gMC->Gspos("CMO2", 1, "CMO1", 0, 500-AliACORDEConstants::Instance()->Depth()/2, ptubs[2]-1900, 0, "MANY");
+
+ // Molasse around the RB24/26 Wall. OK
+ ptubs[0] = 220 + 1600;
+ ptubs[1] = AliACORDEConstants::Instance()->Depth() - ptubs[0];
+ ptubs[2] = 2987.7/2 - 1100/4 - concreteWidth/2;
+ ptubs[3] = 0;
+ ptubs[4] = 180;
+ gMC->Gsvolu("CMO3", "TUBS", idtmed[1123], ptubs, 5);
+ gMC->Gspos("CMO3", 1, "CMO1", 70, 40-AliACORDEConstants::Instance()->Depth()/2, -1900 - ptubs[2], 0, "MANY");
+
+ // A big block above the RB24/26 wall. OK
+ pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
+ pbox[1] = (AliACORDEConstants::Instance()->Depth() - 220 - 1600)/2;
+ pbox[2] = 2987.7/2 - 1100/4 - concreteWidth/2;
+ gMC->Gsvolu("CMO4", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CMO4", 1, "CMO1", 0, AliACORDEConstants::Instance()->Depth()/2 - pbox[1], -1900 - pbox[2], 0, "MANY");
+ // Small blocks below the volume CMO4 on both sides of the wall RB24/26. OK
+ pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
+ptubs[0])/2;
+ pbox[1] = AliACORDEConstants::Instance()->Depth()/2 - pbox[1];
+ gMC->Gsvolu("CM17", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CM17", 1, "CMO1", AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], -AliACORDEConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
+ gMC->Gspos("CM17", 2, "CMO1", -AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad)+ pbox[0], -AliACORDEConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
+
+ // And a big block of molasse above the hall up to the surface. OK
+ pbox[0] = pm25X - pm25radius;
+ pbox[1] = (AliACORDEConstants::Instance()->Depth()-500-1170)/2;
+ pbox[2] = (1900 + 1150)/2;
+ gMC->Gsvolu("CMO5", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CMO5", 1, "CMO1", 0,AliACORDEConstants::Instance()->Depth()/2-pbox[1], pbox[2]-1900, 0, "MANY");
+ // Small blocks of molasse betwen the blocks CMO2, CMO5 and PM25. Ok
+ pbox[0] = (pm25X - pm25radius - 1170)/2;
+ pbox[1] = 1000;
+ gMC->Gsvolu("CM16", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CM16", 1, "CMO1", 1170 + pbox[0], -AliACORDEConstants::Instance()->Depth()/2+pbox[1], pbox[2] - 1900, 0, "MANY");
+
+ // Molasse around the shafts.
+ AliMatrix(idrotm[2003], 0, 0, 90, 0, 90, 90);
+ // Around the PX24, the open section. OK
+ ptubs[0] = px24radius + concreteWidth;
+ ptubs[1] = ptubs[0] + 1000;
+ ptubs[2] = (2300 - (5150 - AliACORDEConstants::Instance()->Depth()))/2;
+ ptubs[3] = 180 + kRaddeg*TMath::ASin(1070/ptubs[0]);
+ ptubs[4] = 180 - kRaddeg*TMath::ASin(1070/ptubs[0]);
+ gMC->Gsvolu("CMO6", "TUBS", idtmed[1123], ptubs, 5);
+ gMC->Gspos("CMO6", 1, "CMO1", px24X, ptubs[2] - AliACORDEConstants::Instance()->Depth()/2, px24Z, idrotm[2003], "MANY");
+ // Around the PX24, the closed section. OK
+ Float_t ptube[3];
+ ptube[0] = px24radius + concreteWidth;
+ ptube[1] = ptube[0] + 1000;
+ ptube[2] = (5150 - 2300)/2;
+ gMC->Gsvolu("CMO7", "TUBE", idtmed[1123], ptube, 3);
+ gMC->Gspos("CMO7", 1, "CMO1", px24X, AliACORDEConstants::Instance()->Depth()/2 - ptube[2], px24Z, idrotm[2003], "MANY");
+
+ // Around PM25. OK
+ ptube[0] = pm25radius + concreteWidth;
+ ptube[1] = ptube[0] + 400;
+ ptube[2] = AliACORDEConstants::Instance()->Depth()/2;
+ gMC->Gsvolu("CMO8", "TUBE", idtmed[1123], ptube, 3);
+ gMC->Gspos("CMO8", 1, "CMO1", pm25X, 0, pm25Z, idrotm[2003], "MANY");
+ // On both sides of the PM25 along the HALL.
+ pbox[0] = (2100 + pm25radius - 1170)/2;
+ pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
+ pbox[2] = (3*px24radius - pm25radius)/2;
+ gMC->Gsvolu("CM18", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CM18", 1, "CMO1", 2100, 0, pbox[2] + pm25radius, 0, "MANY");
+
+ pbox[2] = (1900 - pm25radius)/2;
+ gMC->Gsvolu("CM19", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CM19", 1, "CMO1", 2100, 0, -pbox[2] - pm25radius, 0, "MANY");
+
+ // Around the PGC2. OK
+ ptube[0] = pgc2radius + concreteWidth;
+ ptube[1] = 2987.7 - 740;
+ ptube[2] = AliACORDEConstants::Instance()->Depth()/2;
+ gMC->Gsvolu("CMO9", "TUBE", idtmed[1123], ptube, 3);
+ gMC->Gspos("CMO9", 1, "CMO1", pgc2X, 0, pgc2Z, idrotm[2003], "MANY");
+
+ // On both sides of the PGC2.OK
+ pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
+1100 - 375)/2;
+ pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
+ pbox[2] = pgc2radius + concreteWidth;
+ gMC->Gsvolu("CM10", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CM10", 1, "CMO1", AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], 0, pgc2Z, 0, "MANY");
+ gMC->Gspos("CM10", 2, "CMO1", -AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) + pbox[0], 0, pgc2Z, 0, "MANY");
+
+ // big block of molasse behind the PX24. OK
+ pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
+ pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
+ pbox[2] = (pbox[0] - (2300 + 1150 + 100))/2;
+ gMC->Gsvolu("CM12", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CM12", 1, "CMO1", px24X, 0, px24Z + px24radius + concreteWidth + pbox[2], 0, "MANY");
+
+ // big block of molasse in the opposite side of the PM25. OK
+ pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
+1150)/2;
+ pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
+ pbox[2] = (1900 + 2300 + 1150)/2;
+ gMC->Gsvolu("CM13", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CM13", 1, "CMO1", -1150 - pbox[0], 0, pbox[2] - 1900, 0, "MANY");
+
+ // big block of molasse behind the PM25. OK
+ pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
+(2100 + 910/2 + 100))/2;
+ pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
+ pbox[2] = (1900 + 2300 + 1150)/2;
+ gMC->Gsvolu("CM14", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CM14", 1, "CMO1", pm25X + pm25radius + concreteWidth + pbox[0], 0, pbox[2] - 1900, 0, "MANY");
+
+ // big block of molasse behind the PGC2. OK
+ pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
+ pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
+ pbox[2] = (pbox[0] - (2987.7 + 1900 + 1100/2 + 100))/2;
+ gMC->Gsvolu("CM15", "BOX", idtmed[1123], pbox, 3);
+ gMC->Gspos("CM15", 1, "CMO1", 0, 0, -pbox[0] + pbox[2], 0, "MANY");
+
+ gMC->Gspos("CMO1",1,"ACORDE",0,AliACORDEConstants::Instance()->Depth()/2,0,0,"MANY");
}
-//_____________________________________________________________________________
-void AliACORDEv0::CreateGeometry()
+void AliACORDEv0::CreateAcorde()
{
//
// Create geometry for the ACORDE array
+ // done in two main steps
+ // 1.- definition of the modules
+ // 2.- placement of the modules
//
-
Int_t idrotm[2499]; // The rotation matrix.
Int_t* idtmed = fIdtmed->GetArray() - 1099;
- AliACORDEConstants* crtConstants = AliACORDEConstants::Instance();
-
- // Create the mother volume.
- // This volume can be seen as the volume which ACORDE will ocupate
- // above the upper face of the L3 magnet. Inside this volume the detectors
- // aboce the magnet will be, then there will be two copies of this volume,
- // one for each side.
+ AliACORDEConstants* constants = AliACORDEConstants::Instance();
Float_t box[3];
- //box[0] = 2*crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
- box[0] = crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
- box[1] = crtConstants->MagMaxRadius() - crtConstants->MagMinRadius();
- box[2] = crtConstants->MagnetLenght()/2;
- gMC->Gsvolu("ACORDE1", "BOX", idtmed[1112], box, 3);
-
- // Check if the AliACORDEModule instance have been set, otherwise
- // use the default values
- if ( !fModule ) {
- Info("CreateGeometry", "Using default dimensions");
- fModule = new AliACORDEModule("ACORDEmod", "Default module dimensions");
- }
+ Float_t placed_at;
+ Float_t placed_at2;
+ Float_t small = 0.05; // to separate slightly some volumes
+ // by half a mm so that they do not overlap
+
+
+ // 1.- Definition of a module
+ // * ACORDE1 => volume filled with air, representing a module
+ // it contains all other volumes defining the module
+ // there are 60 copies of it
+ // * ACORDE2 => volume defining one scintillator pad
+ // there are 2 copies of it per module
+ // * ACORDE3-6 => volumes representing the Al walls of box
+ // surrounding the plastic
+ // 3: long wall, 2 copies (front, back)
+ // 4: end caps, 2 copies (left, right)
+ // 5: long stripe to model the profile
+ // 4 copies (upper front and back, lower)
+ // 6: short stripe to model the profile
+ // 4 copies (upper left, right; lower)
// The full module volume.
// This volume will be ocupied by all the material of the module
// the scintillators, the aluminium frame, etc.
- box[0] = fModule->FrameLength()/2;
- box[1] = fModule->FrameThickness()/2;
- box[2] = fModule->FrameWidth()/2;
- gMC->Gsvolu("ACORDE2", "BOX", idtmed[1114], box, 3);
+ box[0] = constants->ModuleLength()/2;
+ box[1] = constants->ModuleHeight()/2;
+ box[2] = constants->ModuleWidth()/2;
+ gMC->Gsvolu("ACORDE1", "BOX", idtmed[1114], box, 3);
// The scintillators
- box[0] = crtConstants->SinglePaletteLenght()/4;
- box[1] = crtConstants->SinglePaletteHeight();
- box[2] = crtConstants->SinglePaletteWidth()/2;
- gMC->Gsvolu("ACORDE3", "BOX", idtmed[1112], box, 3);
- gMC->Gspos("ACORDE3", 1, "ACORDE2", 0, 2, 0, 0, "ONLY");
-
- // The metallic frame
- box[0] = fModule->FrameLength()/2;
- box[1] = fModule->FrameThickness()/2;
- box[2] = 2;
+ box[0] = constants->PlasticLength()/2;
+ box[1] = constants->PlasticHeight()/2;
+ box[2] = constants->PlasticWidth()/2;
+ gMC->Gsvolu("ACORDE2", "BOX", idtmed[1112], box, 3);
+
+ // it is important to keep this order for easy assignment of
+ // a volume to a physical module:
+ placed_at = box[1]+constants->ProfileThickness()
+ - constants->ModuleHeight()/2+small;
+ gMC->Gspos("ACORDE2", 1, "ACORDE1", 0, placed_at, 0, 0, "MANY");
+ placed_at = placed_at + 2.0*box[1]+small;
+ gMC->Gspos("ACORDE2", 2, "ACORDE1", 0, placed_at, 0, 0, "MANY");
+
+
+ // The metallic frame: long walls of box
+ // back,front,left,right, defined looking
+ // from the + z diraction into alice; i.e.
+ // back ==> z<0, front ==> z>0
+ // left ==> x<0, right ==> x>0
+ // up ==> increasing y, down ==> decreasing y
+ box[0] = constants->ModuleLength()/2;
+ box[1] = constants->ModuleHeight()/2;
+ box[2] = constants->ProfileThickness()/2.0;
+ gMC->Gsvolu("ACORDE3", "BOX", idtmed[1108], box, 3);
+ // front wall
+ placed_at = constants->ModuleWidth()/2-constants->ProfileThickness()/2.0;
+ gMC->Gspos("ACORDE3", 1, "ACORDE1", 0, 0, placed_at, 0, "MANY");
+ // back wall
+ gMC->Gspos("ACORDE3", 2, "ACORDE1", 0, 0, -placed_at , 0, "MANY");
+
+ // The metallic frame: end caps
+ box[0] = constants->ProfileThickness()/2.0;
+ box[1] = constants->ModuleHeight()/2;
+ box[2] = constants->ModuleWidth()/2;
gMC->Gsvolu("ACORDE4", "BOX", idtmed[1108], box, 3);
- gMC->Gspos("ACORDE4", 1, "ACORDE2", 0, 0, 13 - box[2], 0, "MANY");
- gMC->Gspos("ACORDE4", 2, "ACORDE2", 0, 0, -13 + box[2], 0, "MANY");
-
- box[0] = 2;
- box[1] = fModule->FrameThickness()/2;
- box[2] = fModule->FrameWidth()/2;
+ // right cap
+ placed_at = constants->ModuleLength()/2-constants->ProfileThickness()/2.0;
+ gMC->Gspos("ACORDE4", 1, "ACORDE1", placed_at, 0, 0, 0, "MANY");
+ // left cap
+ gMC->Gspos("ACORDE4", 2, "ACORDE1", -placed_at, 0, 0, 0, "MANY");
+
+ // The metallic frame: the profile, long stripes
+ box[0] = constants->ModuleLength()/2.0;
+ box[1] = constants->ProfileThickness()/2;
+ box[2] = constants->ProfileWidth()/2;
gMC->Gsvolu("ACORDE5", "BOX", idtmed[1108], box, 3);
- gMC->Gspos("ACORDE5", 1, "ACORDE2", 140 - box[0], 0, 0, 0, "MANY");
- gMC->Gspos("ACORDE5", 2, "ACORDE2", -140 + box[0], 0, 0, 0, "MANY");
-
- // The support bars
- box[0] = 2;
- box[1] = fModule->FrameThickness()/2;
- box[2] = 500;
+ // upper front
+ placed_at = constants->ModuleHeight()/2-box[1];
+ placed_at2 = constants->ModuleWidth()/2-
+ constants->ProfileThickness()-box[2];
+ gMC->Gspos("ACORDE5", 1, "ACORDE1",0,placed_at,placed_at2, 0, "MANY");
+ // upper back
+ gMC->Gspos("ACORDE5", 2, "ACORDE1",0,placed_at,-placed_at2, 0, "MANY");
+ // lower front
+ gMC->Gspos("ACORDE5", 3, "ACORDE1",0,-placed_at,placed_at2, 0, "MANY");
+ // lower back
+ gMC->Gspos("ACORDE5", 4, "ACORDE1",0,-placed_at,-placed_at2, 0, "MANY");
+
+ // The metallic frame: the profile, long stripes
+ box[0] = constants->ProfileWidth()/2.0;
+ box[1] = constants->ProfileThickness()/2;
+ box[2] = constants->ModuleWidth()/2-constants->ProfileWidth();
gMC->Gsvolu("ACORDE6", "BOX", idtmed[1108], box, 3);
+ // upper right
+ placed_at = constants->ModuleHeight()/2-box[1];
+ placed_at2 = constants->ModuleLength()/2-
+ constants->ProfileThickness()-box[0];
+ gMC->Gspos("ACORDE6", 1, "ACORDE1",placed_at2,placed_at,0, 0, "MANY");
+ // upper left
+ gMC->Gspos("ACORDE6", 2, "ACORDE1",-placed_at2,placed_at,0, 0, "MANY");
+ // lower right
+ gMC->Gspos("ACORDE6", 3, "ACORDE1",placed_at2,-placed_at,0, 0, "MANY");
+ // lower left
+ gMC->Gspos("ACORDE6", 4, "ACORDE1",-placed_at2,-placed_at,0, 0, "MANY");
+
+ // End of MODULE definition
+
+ ////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////
+
+ // 2.- placement of the module
+ // Now put all of them in the right position in
+ // master volume ALIC
+
+ // rotation matrices (see Geant manual for conventions)
+ // for columns 4 and 5
+ AliMatrix(idrotm[231], 90, 45, 90, 135, 0, 0);
+ // for columns 0 and 1
+ AliMatrix(idrotm[232], 90, 315, 90, 45, 0, 0);
- // Now put into the volume CR11 all the above volumes.
- // 20 scintillation modules
- // 4 support bars
- Int_t copyNumber = 0;
- for ( Int_t k = 0; k < fModule->NumberOfRows(); k++ ) {
- Float_t zCoordinate = k*fModule->ZGap() - 450;
- gMC->Gspos("ACORDE2",++copyNumber,"ACORDE1",-150, 15, zCoordinate, 0, "MANY");
- gMC->Gspos("ACORDE2",++copyNumber,"ACORDE1",150, 15, zCoordinate, 0, "MANY");
+ // place each one of the 6 columns in turn
+ // for the first and the last column the position
+ // of the two last modules depends on the value
+ // of the fITSGeometry variable
+
+ // it is important to keep this order because
+ // the copy number defines the module!
+
+ // first column, except first and last modules
+ for (Int_t copy = 2; copy < 10; copy++)
+ gMC->Gspos("ACORDE1",copy,"ALIC",
+ constants->ModulePositionX(copy-1),
+ constants->ModulePositionY(copy-1),
+ constants->ModulePositionZ(copy-1),
+ idrotm[232], "MANY");
+ // second column
+ for (Int_t copy = 11; copy < 21; copy++)
+ gMC->Gspos("ACORDE1",copy,"ALIC",
+ constants->ModulePositionX(copy-1),
+ constants->ModulePositionY(copy-1),
+ constants->ModulePositionZ(copy-1),
+ idrotm[232], "MANY");
+ // third and fourth columns
+ for (Int_t copy = 21; copy < 41; copy++)
+ gMC->Gspos("ACORDE1",copy,"ALIC",
+ constants->ModulePositionX(copy-1),
+ constants->ModulePositionY(copy-1),
+ constants->ModulePositionZ(copy-1),
+ 0, "MANY");
+ // fifth column
+ for (Int_t copy = 41; copy < 51; copy++)
+ gMC->Gspos("ACORDE1",copy,"ALIC",
+ constants->ModulePositionX(copy-1),
+ constants->ModulePositionY(copy-1),
+ constants->ModulePositionZ(copy-1),
+ idrotm[231], "MANY");
+ // last column, except first and last modules
+ for (Int_t copy = 52; copy < 60; copy++)
+ gMC->Gspos("ACORDE1",copy,"ALIC",
+ constants->ModulePositionX(copy-1),
+ constants->ModulePositionY(copy-1),
+ constants->ModulePositionZ(copy-1),
+ idrotm[231], "MANY");
+ // the last four modules
+ if (GetITSGeometry()) {
+ gMC->Gspos("ACORDE1",1,"ALIC",
+ constants->ExtraModulePositionX(),
+ constants->ExtraModulePositionY(),
+ constants->ExtraModulePositionZ(0),
+ 0, "MANY");
+ gMC->Gspos("ACORDE1",10,"ALIC",
+ constants->ExtraModulePositionX(),
+ constants->ExtraModulePositionY(),
+ constants->ExtraModulePositionZ(1),
+ 0, "MANY");
+ gMC->Gspos("ACORDE1",51,"ALIC",
+ constants->ExtraModulePositionX(),
+ constants->ExtraModulePositionY(),
+ constants->ExtraModulePositionZ(2),
+ 0, "MANY");
+ gMC->Gspos("ACORDE1",60,"ALIC",
+ constants->ExtraModulePositionX(),
+ constants->ExtraModulePositionY(),
+ constants->ExtraModulePositionZ(3),
+ 0, "MANY");
+ } else {
+ gMC->Gspos("ACORDE1",1,"ALIC",
+ constants->ModulePositionX(0),
+ constants->ModulePositionY(0),
+ constants->ModulePositionZ(0),
+ idrotm[232], "MANY");
+ gMC->Gspos("ACORDE1",10,"ALIC",
+ constants->ModulePositionX(9),
+ constants->ModulePositionY(9),
+ constants->ModulePositionZ(9),
+ idrotm[232], "MANY");
+ gMC->Gspos("ACORDE1",51,"ALIC",
+ constants->ModulePositionX(50),
+ constants->ModulePositionY(50),
+ constants->ModulePositionZ(50),
+ idrotm[231], "MANY");
+ gMC->Gspos("ACORDE1",60,"ALIC",
+ constants->ModulePositionX(59),
+ constants->ModulePositionY(59),
+ constants->ModulePositionZ(59),
+ idrotm[231], "MANY");
+ } // end if (fITSGeometry)
- }
+}
+//_____________________________________________________________________________
+void AliACORDEv0::DrawDetector() const
+{
- // Put the support bars
- gMC->Gspos("ACORDE6", 1, "ACORDE1", -75, 5, 0, 0, "ONLY");
- gMC->Gspos("ACORDE6", 2, "ACORDE1", -225, 5, 0, 0, "ONLY");
- gMC->Gspos("ACORDE6", 3, "ACORDE1", 75, 5, 0, 0, "ONLY");
- gMC->Gspos("ACORDE6", 4, "ACORDE1", 225, 5, 0, 0, "ONLY");
+ // not needed anymore
- // Now put a copy of CR11 on the 3 upper faces of the magnet
- // In the right side side of the magnet
- AliMatrix(idrotm[231], 90, 45, 90, 135, 0, 0);
- // In the left side side of the magnet
- AliMatrix(idrotm[232], 90, 315, 90, 45, 0, 0);
+}
- Float_t x = crtConstants->MagMinRadius()+10;
- gMC->Gspos("ACORDE1", 1, "ALIC", 0, x, 0, 0, "MANY");
- gMC->Gspos("ACORDE1", 2, "ALIC", -x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[231], "MANY");
- gMC->Gspos("ACORDE1", 3, "ALIC", x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[232], "MANY");
+//____________________________________________________________________________
+
+void AliACORDEv0::Init()
+{
+ // Initialise L3 magnet after it has been built
+ Int_t i;
+ if(AliLog::GetGlobalDebugLevel()>0) {
+ printf("\n%s: ",ClassName());
+ for(i=0;i<35;i++) printf("*");
+ printf(" ACORDEv0_INIT ");
+ for(i=0;i<35;i++) printf("*");
+ printf("\n%s: ",ClassName());
+ // Here the ACORDEv initialisation code (if any!)
+ for(i=0;i<80;i++) printf("*");
+ printf("\n");
+ }
+ // AliACORDE::Init();
+}
+//____________________________________________________________________________
+void AliACORDEv0::StepManager()
+{
+ //
+ // Called for every step in the Cosmic Ray Trigger
+ //
+
+
+ // volume:
+ // [0] = module number 1-60 (1==>(0-0), 60 (5-9)
+ // [1] = Plastic number: 0 (down) to 1 (up)
+ static Int_t vol[2];
+ //
+ // hit
+ // [0] = PID
+ // [1-3] = x, y, z
+ // [4] = time
+ // [5-7] = px, py, pz
+ // [8] = energy
+ // [9] = energy loss
+ // [10] = length of track through plastic
+ static Float_t hits[11];
+
+ // local static variables
+ static Float_t eloss;
+ static Float_t step;
+ // scintillator volume
+ static Int_t idScint = gMC->VolId("ACORDE2");
+
+ // local variables
+ Int_t copy;
+ TLorentzVector pos;
+ TLorentzVector mom;
+
+ // only charged tracks
+ if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
+
+ // only in sensitive material
+ if (gMC->CurrentVolID(copy) == idScint) {
+ step += gMC->TrackStep();
+ eloss += gMC->Edep();
+ // set all hit variables except eloss which is resetted
+ // set volume variables
+ if (gMC->IsTrackEntering()) {
+ eloss = 0.0;
+ step = 0.0;
+ gMC->TrackPosition(pos);
+ gMC->TrackMomentum(mom);
+ // hit
+ // [0] = PID
+ // [1-3] = x, y, z
+ // [4] = time
+ // [5-7] = px, py, pz
+ // [8] = energy
+ // [9] = energy loss
+ hits[0] = (Float_t ) gMC->TrackPid();
+ hits[1] = pos[0];
+ hits[2] = pos[1];
+ hits[3] = pos[2];
+ hits[4] = gMC->TrackTime();
+ hits[5] = mom[0];
+ hits[6] = mom[1];
+ hits[7] = mom[2];
+ hits[8] = gMC->Etot();
+ // volume:
+ // [0] = module number 1-60 (1==>(0-0), 60 (5-9)
+ // [1] = Plastic number: 0 (down) to 1 (up)
+ Int_t copyPlastic; // plastic: down=1, up=2
+ Int_t copyModule; // module: 1-60
+ gMC->CurrentVolID(copyPlastic);
+ gMC->CurrentVolOffID(1, copyModule);
+ // module
+ vol[0] = copyModule;
+ // plastic: 0 = down, 1 = up
+ vol[1] = copyPlastic;
+ } // end if gMC->IsTrackEntering()
+
+ // set hit[9] = total energy loss and book hit
+ if( gMC->IsTrackExiting() ||
+ gMC->IsTrackStop() ||
+ gMC->IsTrackDisappeared()){
+ hits[9] = eloss;
+ hits[10] = step;
+ eloss = 0.0;
+ step = 0.0;
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
+ }
+ } // end if in scintillator
}
//_____________________________________________________________________________
-void AliACORDEv0::DrawDetector() const
+void AliACORDEv0::AddHit(Int_t track, Int_t *vol, Float_t *hits)
{
//
- // Draw a shaded view of the L3 magnet
+ // Add a ACORDE hit
//
-
- Info("DrawDetector", "Drawing the module");
-
- gMC->Gsatt("*", "seen", -1);
-
- gMC->Gsatt("ALIC","seen",0);
-
- gMC->Gsatt("L3MO","seen",0); // L3 Magnet, Mother
- gMC->Gsatt("L3CO","seen",1); // Coils
- gMC->Gsatt("L3C1","seen",1); // Coils
- gMC->Gsatt("L3YO","seen",1); // Yoke
- gMC->Gsatt("L3DO","seen",0); // return Yoke (DOOR)
- gMC->Gsatt("L3FR","seen",1); // DOOR
- gMC->Gsatt("L3IR","seen",0); // Inner layer
- gMC->Gsatt("L3O1","seen",1); // Door opening
- gMC->Gsatt("L3O2","seen",1); // Door opening
-
- gMC->Gsatt("ACORDE1", "seen", 0); // ACORDE Mother
- gMC->Gsatt("ACORDE2", "seen", 0); // Module air box
- gMC->Gsatt("ACORDE3", "seen", 1); // Scintillators
- gMC->Gsatt("ACORDE3", "colo", 2); // Scintillators
- gMC->Gsatt("ACORDE4", "seen", 1); // Aluminium frame (long bars)
- gMC->Gsatt("ACORDE4", "colo", 3); //
- gMC->Gsatt("ACORDE5", "seen", 1); // Aluminium frame (short bars)
- gMC->Gsatt("ACORDE5", "colo", 3); //
- gMC->Gsatt("ACORDE6", "seen", 1); // Module support
- gMC->Gsatt("ACORDE6", "colo", 3); //
-
- gMC->Gdopt("hide", "on");
- gMC->Gdopt("edge","off");
- gMC->Gdopt("shad", "on");
- gMC->Gsatt("*", "fill", 7);
- gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
- gMC->DefaultRange();
- //gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009);
- gMC->Gdraw("alic", 30, 40, 0, -30, -60, .09, .09);
- gMC->Gdhead(1111, "View of ACORDE(ACORDE)");
- gMC->Gdman(18, 4, "MAN");
+ TClonesArray &lhits = *fHits;
+ new(lhits[fNhits++]) AliACORDEhit(fIshunt,track,vol,hits);
}
+
AliACORDEv0(const char *name, const char *title);
virtual ~AliACORDEv0();
- virtual void CreateGeometry();
+ virtual TString Version() { return TString("v0"); }
+ virtual Int_t IsVersion() const { return 1; }
+ virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
+
virtual void BuildGeometry();
+ virtual void CreateGeometry();
+
+ virtual void Init();
virtual void DrawDetector() const;
+ virtual void StepManager();
+
protected:
- virtual void CreateMolasse() {}
- virtual void CreateShafts() {}
+ virtual void CreateCavern();
+ virtual void CreateShafts();
+ virtual void CreateMolasse();
+ virtual void CreateAcorde();
private:
AliACORDEv0(const AliACORDEv0& crt);
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id$ */
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// ALICE Cosmic Ray Trigger //
-// //
-// This class contains the functions for version 0 of the ALICE Cosmic Ray //
-// Trigger. This vesion is suposed to work as standalone module //
-// //
-//
-// Authors:
-//
-// Arturo Fernandez <afernand@fcfm.buap.mx>
-// Enrique Gamez <egamez@fcfm.buap.mx>
-//
-// Universidad Autonoma de Puebla
-//
-//
-//Begin_Html
-/*
-<img src="picts/AliACORDEv1Class.gif">
-</pre>
-<br clear=left>
-<p>The responsible person for this module is
-<a href="mailto:egamez@fcfm.buap.mx">Enrique Gamez</a>.
-</font>
-<pre>
-*/
-//End_Html
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-#include "AliACORDEv1.h"
-
-#include <TClonesArray.h>
-#include <TLorentzVector.h>
-#include <TPDGCode.h>
-#include <TVirtualMC.h>
-
-#include "AliRun.h"
-#include "AliConst.h"
-
-#include "AliACORDEhit.h"
-#include "AliACORDEModule.h"
-#include "AliACORDEConstants.h"
-#include "AliMC.h"
-#include "AliLog.h"
-
-ClassImp(AliACORDEv1)
-
-//_____________________________________________________________________________
-AliACORDEv1::AliACORDEv1()
- : AliACORDE()
-{
- //
- // Default constructor
- //
- fIshunt = 0;
- fHits = 0;
-}
-
-//_____________________________________________________________________________
-AliACORDEv1::AliACORDEv1(const char *name, const char *title)
- : AliACORDE(name, title)
-{
- //
- // Standard constructor
- //
- //Begin_Html
- /*
- <img src="picts/AliACORDEv1.gif">
- */
- //End_Html
- fIshunt = 1; // All hits are associated with primary particles
-
- fHits = new TClonesArray("AliACORDEhit",400);
- gAlice->GetMCApp()->AddHitList(fHits);
-
- //PH SetMarkerColor(7);
- //PH SetMarkerStyle(2);
- //PH SetMarkerSize(0.4);
-}
-
-//_____________________________________________________________________________
-AliACORDEv1::~AliACORDEv1()
-{
- //
- // Default destructor
- //
-}
-
-//_____________________________________________________________________________
-void AliACORDEv1::CreateMaterials()
-{
- //
- // Create Materials.
- // Use the parent class definition of the materials
- //
- AliACORDE::CreateMaterials();
-}
-
-//_____________________________________________________________________________
-void AliACORDEv1::CreateGeometry()
-{
- //
- // Create geometry for the ACORDE array
- //
-
- Int_t idrotm[2499]; // The rotation matrix.
- Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
- AliACORDEConstants* crtConstants = AliACORDEConstants::Instance();
-
- // Create the mother volume, the one which will contain all the material
- // above the hall.
- Float_t pbox[3];
- pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
- //pbox[0] = 12073;
- pbox[1] = crtConstants->Depth();
- pbox[2] = pbox[0];
- gMC->Gsvolu("ACORDE", "BOX", idtmed[1114], pbox, 3);
- gMC->Gspos("ACORDE", 1, "ALIC", 0, 0, 0, 0, "ONLY");
-
- // Shafts.
- this->CreateShafts();
-
- // Molasse.
- this->CreateMolasse();
-
- // This volume can be seen as the volume which ACORDE will ocupate
- // above the upper face of the L3 magnet. Inside this volume the detectors
- // aboce the magnet will be, then there will be two copies of this volume,
- // one for each side.
- Float_t box[3];
- //box[0] = 2*crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
- box[0] = crtConstants->MagMinRadius()*TMath::Sin(kDegrad*22.5);
- box[1] = crtConstants->MagMaxRadius() - crtConstants->MagMinRadius();
- box[2] = crtConstants->MagnetLenght()/2;
- gMC->Gsvolu("ACORDE1", "BOX", idtmed[1134], box, 3);
-
- // Check if the AliACORDEModule instance have been set, otherwise
- // use the default values
- if ( !fModule ) {
- Info("CreateGeometry", "Using default dimensions");
- fModule = new AliACORDEModule("ACORDEmod", "Default module dimensions");
- }
-
- // The full module volume.
- // This volume will be ocupied by all the material of the module
- // the scintillators, the aluminium frame, etc.
- box[0] = fModule->FrameLength()/2;
- box[1] = fModule->FrameThickness()/2;
- box[2] = fModule->FrameWidth()/2;
- gMC->Gsvolu("ACORDE2", "BOX", idtmed[1114], box, 3);
-
- // The scintillators
- box[0] = crtConstants->SinglePaletteLenght()/4;
- box[1] = crtConstants->SinglePaletteHeight();
- box[2] = crtConstants->SinglePaletteWidth()/2;
- gMC->Gsvolu("ACORDE3", "BOX", idtmed[1112], box, 3);
- gMC->Gspos("ACORDE3", 1, "ACORDE2", 0, 2, 0, 0, "ONLY");
-
- // The metallic frame
- box[0] = fModule->FrameLength()/2;
- box[1] = fModule->FrameThickness()/2;
- box[2] = 2;
- gMC->Gsvolu("ACORDE4", "BOX", idtmed[1108], box, 3);
- gMC->Gspos("ACORDE4", 1, "ACORDE2", 0, 0, 13 - box[2], 0, "MANY");
- gMC->Gspos("ACORDE4", 2, "ACORDE2", 0, 0, -13 + box[2], 0, "MANY");
-
- box[0] = 2;
- box[1] = fModule->FrameThickness()/2;
- box[2] = fModule->FrameWidth()/2;
- gMC->Gsvolu("ACORDE5", "BOX", idtmed[1108], box, 3);
- gMC->Gspos("ACORDE5", 1, "ACORDE2", 140 - box[0], 0, 0, 0, "MANY");
- gMC->Gspos("ACORDE5", 2, "ACORDE2", -140 + box[0], 0, 0, 0, "MANY");
-
- // The support bars
- box[0] = 2;
- box[1] = fModule->FrameThickness()/2;
- box[2] = 500;
- gMC->Gsvolu("ACORDE6", "BOX", idtmed[1108], box, 3);
-
- // Now put into the volume CR11 all the above volumes.
- // 20 scintillation modules
- // 4 support bars
- Int_t copyNumber = 0;
- for ( Int_t k = 0; k < fModule->NumberOfRows(); k++ ) {
- Float_t zCoordinate = k*fModule->ZGap() - 450;
- gMC->Gspos("ACORDE2",++copyNumber,"ACORDE1",-150, 15, zCoordinate, 0, "MANY");
- gMC->Gspos("ACORDE2",++copyNumber,"ACORDE1",150, 15, zCoordinate, 0, "MANY");
-
- }
-
- // Put the support bars
- gMC->Gspos("ACORDE6", 1, "ACORDE1", -75, 5, 0, 0, "ONLY");
- gMC->Gspos("ACORDE6", 2, "ACORDE1", -225, 5, 0, 0, "ONLY");
- gMC->Gspos("ACORDE6", 3, "ACORDE1", 75, 5, 0, 0, "ONLY");
- gMC->Gspos("ACORDE6", 4, "ACORDE1", 225, 5, 0, 0, "ONLY");
-
- // Now put a copy of CR11 on the 3 upper faces of the magnet
- // In the right side side of the magnet
- AliMatrix(idrotm[231], 90, 45, 90, 135, 0, 0);
- // In the left side side of the magnet
- AliMatrix(idrotm[232], 90, 315, 90, 45, 0, 0);
-
- Float_t x = crtConstants->MagMaxRadius();
- gMC->Gspos("ACORDE1", 1, "ALIC", 0, x, 0, 0, "MANY");
- gMC->Gspos("ACORDE1", 2, "ALIC", -x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[231], "MANY");
- gMC->Gspos("ACORDE1", 3, "ALIC", x*TMath::Sin(kDegrad*45), x*TMath::Cos(kDegrad*45), 0, idrotm[232], "MANY");
-
-}
-
-//_____________________________________________________________________________
-void AliACORDEv1::CreateMolasse()
-{
- //
- //
- //
- Int_t idrotm[2499]; // The rotation matrix.
- Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
-
- Float_t px24radius = 2300/2;
- Float_t px24X = 0;
- //Float_t px24Y = ;
- Float_t px24Z = 2300;
-
- Float_t pm25radius = 910/2;
- Float_t pm25X = 2100;
- //Float_t pm25Y = ;
- Float_t pm25Z = 0;
-
- Float_t pgc2radius = 1100/2;
- Float_t pgc2X = -375;
- //Float_t pgc2Y = ;
- Float_t pgc2Z = -(1900 + 2987.7);
-
- Float_t concreteWidth = 100; // Standard width of the hall walls.
-
-
- // Create a local mother volume.
- Float_t pbox[3];
- pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
- pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
- pbox[2] = pbox[0];
- gMC->Gsvolu("CMO1", "BOX", idtmed[1114], pbox, 3);
-
- // Now put the molasse exactly above the hall. OK
- // Above the ceiling
- Float_t ptubs[5];
- ptubs[0] = 1170;
- ptubs[1] = 2100 - pm25radius;
- ptubs[2] = 1900/2 + px24radius;
- ptubs[3] = 0;
- ptubs[4] = 180;
- gMC->Gsvolu("CMO2", "TUBS", idtmed[1123], ptubs, 5);
- gMC->Gspos("CMO2", 1, "CMO1", 0, 500-AliACORDEConstants::Instance()->Depth()/2, ptubs[2]-1900, 0, "MANY");
-
- // Molasse around the RB24/26 Wall. OK
- ptubs[0] = 220 + 1600;
- ptubs[1] = AliACORDEConstants::Instance()->Depth() - ptubs[0];
- ptubs[2] = 2987.7/2 - 1100/4 - concreteWidth/2;
- ptubs[3] = 0;
- ptubs[4] = 180;
- gMC->Gsvolu("CMO3", "TUBS", idtmed[1123], ptubs, 5);
- gMC->Gspos("CMO3", 1, "CMO1", 70, 40-AliACORDEConstants::Instance()->Depth()/2, -1900 - ptubs[2], 0, "MANY");
-
- // A big block above the RB24/26 wall. OK
- pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
- pbox[1] = (AliACORDEConstants::Instance()->Depth() - 220 - 1600)/2;
- pbox[2] = 2987.7/2 - 1100/4 - concreteWidth/2;
- gMC->Gsvolu("CMO4", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CMO4", 1, "CMO1", 0, AliACORDEConstants::Instance()->Depth()/2 - pbox[1], -1900 - pbox[2], 0, "MANY");
- // Small blocks below the volume CMO4 on both sides of the wall RB24/26. OK
- pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - ptubs[0])/2;
- pbox[1] = AliACORDEConstants::Instance()->Depth()/2 - pbox[1];
- gMC->Gsvolu("CM17", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CM17", 1, "CMO1", AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], -AliACORDEConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
- gMC->Gspos("CM17", 2, "CMO1", -AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad)+ pbox[0], -AliACORDEConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
-
- // And a big block of molasse above the hall up to the surface. OK
- pbox[0] = pm25X - pm25radius;
- pbox[1] = (AliACORDEConstants::Instance()->Depth()-500-1170)/2;
- pbox[2] = (1900 + 1150)/2;
- gMC->Gsvolu("CMO5", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CMO5", 1, "CMO1", 0,AliACORDEConstants::Instance()->Depth()/2-pbox[1], pbox[2]-1900, 0, "MANY");
- // Small blocks of molasse betwen the blocks CMO2, CMO5 and PM25. Ok
- pbox[0] = (pm25X - pm25radius - 1170)/2;
- pbox[1] = 1000;
- gMC->Gsvolu("CM16", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CM16", 1, "CMO1", 1170 + pbox[0], -AliACORDEConstants::Instance()->Depth()/2+pbox[1], pbox[2] - 1900, 0, "MANY");
-
- // Molasse around the shafts.
- AliMatrix(idrotm[2003], 0, 0, 90, 0, 90, 90);
- // Around the PX24, the open section. OK
- ptubs[0] = px24radius + concreteWidth;
- ptubs[1] = ptubs[0] + 1000;
- ptubs[2] = (2300 - (5150 - AliACORDEConstants::Instance()->Depth()))/2;
- ptubs[3] = 180 + kRaddeg*TMath::ASin(1070/ptubs[0]);
- ptubs[4] = 180 - kRaddeg*TMath::ASin(1070/ptubs[0]);
- gMC->Gsvolu("CMO6", "TUBS", idtmed[1123], ptubs, 5);
- gMC->Gspos("CMO6", 1, "CMO1", px24X, ptubs[2] - AliACORDEConstants::Instance()->Depth()/2, px24Z, idrotm[2003], "MANY");
-
- // Around the PX24, the closed section. OK
- Float_t ptube[3];
- ptube[0] = px24radius + concreteWidth;
- ptube[1] = ptube[0] + 1000;
- ptube[2] = (5150 - 2300)/2;
- gMC->Gsvolu("CMO7", "TUBE", idtmed[1123], ptube, 3);
- gMC->Gspos("CMO7", 1, "CMO1", px24X, AliACORDEConstants::Instance()->Depth()/2 - ptube[2], px24Z, idrotm[2003], "MANY");
-
- // Around PM25. OK
- ptube[0] = pm25radius + concreteWidth;
- ptube[1] = ptube[0] + 400;
- ptube[2] = AliACORDEConstants::Instance()->Depth()/2;
- gMC->Gsvolu("CMO8", "TUBE", idtmed[1123], ptube, 3);
- gMC->Gspos("CMO8", 1, "CMO1", pm25X, 0, pm25Z, idrotm[2003], "MANY");
- // On both sides of the PM25 along the HALL.
- pbox[0] = (2100 + pm25radius - 1170)/2;
- pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
- pbox[2] = (3*px24radius - pm25radius)/2;
- gMC->Gsvolu("CM18", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CM18", 1, "CMO1", 2100, 0, pbox[2] + pm25radius, 0, "MANY");
-
- pbox[2] = (1900 - pm25radius)/2;
- gMC->Gsvolu("CM19", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CM19", 1, "CMO1", 2100, 0, -pbox[2] - pm25radius, 0, "MANY");
-
- // Around the PGC2. OK
- ptube[0] = pgc2radius + concreteWidth;
- ptube[1] = 2987.7 - 740;
- ptube[2] = AliACORDEConstants::Instance()->Depth()/2;
- gMC->Gsvolu("CMO9", "TUBE", idtmed[1123], ptube, 3);
- gMC->Gspos("CMO9", 1, "CMO1", pgc2X, 0, pgc2Z, idrotm[2003], "MANY");
-
- // On both sides of the PGC2.OK
- pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - 1100 - 375)/2;
- pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
- pbox[2] = pgc2radius + concreteWidth;
- gMC->Gsvolu("CM10", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CM10", 1, "CMO1", AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], 0, pgc2Z, 0, "MANY");
- gMC->Gspos("CM10", 2, "CMO1", -AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) + pbox[0], 0, pgc2Z, 0, "MANY");
-
- // big block of molasse behind the PX24. OK
- pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
- pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
- pbox[2] = (pbox[0] - (2300 + 1150 + 100))/2;
- gMC->Gsvolu("CM12", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CM12", 1, "CMO1", px24X, 0, px24Z + px24radius + concreteWidth + pbox[2], 0, "MANY");
-
- // big block of molasse in the opposite side of the PM25. OK
- pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - 1150)/2;
- pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
- pbox[2] = (1900 + 2300 + 1150)/2;
- gMC->Gsvolu("CM13", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CM13", 1, "CMO1", -1150 - pbox[0], 0, pbox[2] - 1900, 0, "MANY");
-
- // big block of molasse behind the PM25. OK
- pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - (2100 + 910/2 + 100))/2;
- pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
- pbox[2] = (1900 + 2300 + 1150)/2;
- gMC->Gsvolu("CM14", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CM14", 1, "CMO1", pm25X + pm25radius + concreteWidth + pbox[0], 0, pbox[2] - 1900, 0, "MANY");
-
- // big block of molasse behind the PGC2. OK
- pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
- pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
- pbox[2] = (pbox[0] - (2987.7 + 1900 + 1100/2 + 100))/2;
- gMC->Gsvolu("CM15", "BOX", idtmed[1123], pbox, 3);
- gMC->Gspos("CM15", 1, "CMO1", 0, 0, -pbox[0] + pbox[2], 0, "MANY");
-
- gMC->Gspos("CMO1",1,"ACORDE",0,AliACORDEConstants::Instance()->Depth()/2,0,0,"MANY");
-
-}
-
-//_____________________________________________________________________________
-void AliACORDEv1::CreateShafts()
-{
- //
- //
- //
- Int_t idrotm[2499]; // The rotation matrix.
- Int_t* idtmed = fIdtmed->GetArray() - 1099 ;
-
- //
- // Acces shafts
- //
- AliMatrix(idrotm[2001], 0, 0, 90, 0, 90, 90);
-
-
- // Create a bing cilinder to hold the main structures in the shaft.
- // All the structures relative to the shaft will be put into
- // this volume.
- // This shaft is composed by an open tube down in the hall, and
- // a cilinder avobe the level of the ceiling.
- Float_t ptube[3];
- ptube[0] = 0; // inner radius
- ptube[1] = 1250; // outer radius
- ptube[2] = 5150/2; // Half lenght in Z
- gMC->Gsvolu("CSF1", "TUBE", idtmed[1114], ptube, 3);
-
- Float_t ptubs[5];
- // The open section of the PX24
- ptubs[0] = 1150; // Inner radius
- ptubs[1] = 1250; // Outer radius
- ptubs[2] = 1300; // Half length
- ptubs[3] = 180 + kRaddeg*TMath::ASin(1070/ptubs[0]); // starting angle
- ptubs[4] = 180 - kRaddeg*TMath::ASin(1070/ptubs[0]);
- gMC->Gsvolu("CSF2", "TUBS", idtmed[1116], ptubs, 5);
- gMC->Gspos("CSF2", 1, "CSF1", 0, 0, -ptube[2] + ptubs[2], 0, "MANY");
-
- // The other part of the shaft.
- ptube[0] = ptubs[0]; // Inner radius
- ptube[1] = ptubs[1]; // Outer radius
- ptube[2] = 5150/2 - ptubs[2]; // Half lenght
- gMC->Gsvolu("CSF3", "TUBE", idtmed[1116], ptube, 3);
- gMC->Gspos("CSF3", 1, "CSF1", 0, 0, 5150/2 - ptube[2], 0, "MANY");
-
- Float_t pbox[3];
- // Concrete walls along the shaft (next to the elevator.)
- pbox[0] = 480/2; // Half length in X
- pbox[1] = 120/2; // Half length in Y
- pbox[2] = 5150/2; // Half length in Z
- gMC->Gsvolu("CSW1", "BOX", idtmed[1116], pbox, 3);
- gMC->Gspos("CSW1", 1, "CSF1", 820+pbox[0], 150+pbox[1], 0, 0, "MANY");
- gMC->Gspos("CSW1", 2, "CSF1", 820+pbox[0], -300-pbox[1], 0, 0, "MANY");
-
- //
- pbox[0] = 120/2; // Half length in X
- pbox[1] = 750/2; // Half length in Y
- pbox[2] = 5150/2; // Half length in Z
- gMC->Gsvolu("CSW2", "BOX", idtmed[1116], pbox, 3);
- gMC->Gspos("CSW2", 1, "CSF1", 820-60, 150+pbox[1], 0, 0, "MANY");
-
- //
- pbox[0] = 120/2; // Half length in X
- pbox[1] = 600/2; // Half lenght in Y
- pbox[2] = 5150/2; // Half length in Z
- gMC->Gsvolu("CSW3", "BOX", idtmed[1116], pbox, 3);
- gMC->Gspos("CSW3", 1, "CSF1", 820-60, -300-pbox[1], 0, 0, "MANY");
-
- // Material below the counting rooms.
- pbox[0] = 400/2;
- pbox[1] = 2300/2;
- pbox[2] = 300/2;
- gMC->Gsvolu("CSW4", "BOX", idtmed[1116], pbox, 3);
- gMC->Gspos("CSW4",1,"CSF1",2300/2-pbox[0],0,3000-5150/2-pbox[2], 0, "MANY");
-
- // Shielding plug.
- pbox[0] = 1400/2;
- pbox[1] = 2300/2;
- pbox[2] = 170/2;
- gMC->Gsvolu("CSW5", "BOX", idtmed[1116], pbox, 3);
- gMC->Gspos("CSW5", 1, "CSF1", 0, 0, 3000-5150/2-130, 0, "MANY");
-
- // The end of the support for the shielding plug.
- pbox[0] = 170/2;
- pbox[1] = 2300/2;
- pbox[2] = 300/2;
- gMC->Gsvolu("CSW6", "BOX", idtmed[1116], pbox, 3);
- gMC->Gspos("CSW6",1,"CSF1",-1400/2-pbox[0],0,3000-5150/2-pbox[2],0,"MANY");
-
- // ...
- pbox[0] = 100/2;
- pbox[1] = 2300/2;
- pbox[2] = 450/2;
- gMC->Gsvolu("CSW7", "BOX", idtmed[1116], pbox, 3);
- gMC->Gspos("CSW7",1,"CSF1",-1400/2-170-pbox[0],0,3000-5150/2+pbox[2],0,"MANY");
-
- // Material close to the pipe.
- pbox[0] = 300/2;
- pbox[1] = 2300/2;
- pbox[2] = 170/2;
- gMC->Gsvolu("CSW8", "BOX", idtmed[1116], pbox, 3);
- gMC->Gspos("CSW8",1,"CSF1",-2300/2+pbox[0],0,2500-5150/2,0,"MANY");
-
- // Now put the shaft into the mother volume.
- gMC->Gspos("CSF1", 1, "ACORDE", 0, AliACORDEConstants::Instance()->Depth() - 5150/2, 2300, idrotm[2001], "MANY");
-
- // PM25 Access Shaft
- ptube[0] = 910/2;
- ptube[1] = ptube[0] + 100;
- ptube[2] = (5150 - 1166)/2;
- gMC->Gsvolu("CSF4", "TUBE", idtmed[1116], ptube, 3);
- gMC->Gspos("CSF4", 1, "ACORDE", 2100, AliACORDEConstants::Instance()->Depth()-ptube[2], 0, idrotm[2001], "MANY");
-
- // PGC2 Access Shaft
- ptube[0] = 1100/2;
- ptube[1] = ptube[0] + 100;
- ptube[2] = (5150 - 690)/2;
- gMC->Gsvolu("CSF5", "TUBE", idtmed[1116], ptube, 3);
- gMC->Gspos("CSF5", 1, "ACORDE", -375, AliACORDEConstants::Instance()->Depth()-ptube[2], -1900 - 2987.7, idrotm[2001], "MANY");
-
-}
-
-//_____________________________________________________________________________
-void AliACORDEv1::DrawDetector() const
-{
- //
- // Draw a shaded view of the L3 magnet
- //
- Info("DrawDetector", "Drawing ACORDE module");
-
- gMC->Gsatt("*", "seen", -1);
- gMC->Gsatt("ALIC", "seen", 0);
- /*
- gMC->Gsatt("L3MO","seen",0); // L3 Magnet, Mother
- gMC->Gsatt("L3CO","seen",1); // Coils
- gMC->Gsatt("L3C1","seen",1); // Coils
- gMC->Gsatt("L3YO","seen",1); // Yoke
- gMC->Gsatt("L3DO","seen",0); // return Yoke (DOOR)
- gMC->Gsatt("L3FR","seen",1); // DOOR
- gMC->Gsatt("L3IR","seen",0); // Inner layer
- gMC->Gsatt("L3O1","seen",1); // Door opening
- gMC->Gsatt("L3O2","seen",1); // Door opening
- */
- gMC->Gsatt("ACORDE", "seen",0); // ACORDE mother volume.
-
- gMC->Gsatt("CMO1","seen",0); // Molasse.
-
- gMC->Gsatt("CSF1","seen",0); // PX24 access shaft.
- gMC->Gsatt("CSF2", "seen", 1); // PX24 open section
- gMC->Gsatt("CSF3", "seen", 1); // PX24, upper part.
- gMC->Gsatt("CSW1", "seen", 1);
- gMC->Gsatt("CSW2", "seen", 1);
- gMC->Gsatt("CSW3", "seen", 1);
- gMC->Gsatt("CSW4", "seen", 1);
- gMC->Gsatt("CSW5", "seen", 1);
- gMC->Gsatt("CSW6", "seen", 1);
- gMC->Gsatt("CSW7", "seen", 1);
- gMC->Gsatt("CSW8", "seen", 1);
-
- gMC->Gsatt("CSF4","seen",1); // PM25 access shaft.
- gMC->Gsatt("CSF5","seen",1); // PGC2 access shaft.
-
- gMC->Gsatt("ACORDE", "seen", 0); // ACORDE Mother volume.
- gMC->Gsatt("ACORDE1", "seen", 0); // ?
- gMC->Gsatt("ACORDE2", "seen", 0); // Module air box
- gMC->Gsatt("ACORDE3", "seen", 1); // Scintillators
- gMC->Gsatt("ACORDE3", "colo", 2); // Scintillators
- gMC->Gsatt("ACORDE4", "seen", 1); // Aluminium frame (long bars)
- gMC->Gsatt("ACORDE4", "colo", 3); //
- gMC->Gsatt("ACORDE5", "seen", 1); // Aluminium frame (short bars)
- gMC->Gsatt("ACORDE5", "colo", 3); //
- gMC->Gsatt("ACORDE6", "seen", 1); // Module support
- gMC->Gsatt("ACORDE6", "colo", 3); //
-
- gMC->Gdopt("hide", "on");
- gMC->Gdopt("edge","off");
- gMC->Gdopt("shad", "on");
- gMC->Gsatt("*", "fill", 7);
- gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
- gMC->DefaultRange();
- gMC->Gdraw("alic", 70, 30, 0, 10, 9.5, .001, .001);
- gMC->Gdhead(1111, "View of ACORDE(ACORDE)");
- gMC->Gdman(18, 4, "MAN");
-
-}
-
-//_____________________________________________________________________________
-void AliACORDEv1::Init()
-{
- //
- // Initialise L3 magnet after it has been built
- Int_t i;
- //
- if(AliLog::GetGlobalDebugLevel()>0) {
- printf("\n%s: ",ClassName());
- for(i=0;i<35;i++) printf("*");
- printf(" ACORDEv1_INIT ");
- for(i=0;i<35;i++) printf("*");
- printf("\n%s: ",ClassName());
- //
- // Here the ACORDEv1 initialisation code (if any!)
- for(i=0;i<80;i++) printf("*");
- printf("\n");
- }
-
-}
-
-//____________________________________________________________________________
-void AliACORDEv1::StepManager()
-{
- //
- // Called for every step in the Cosmic Ray Trigger
- //
- static Int_t vol[1];
- Int_t ipart;
- TLorentzVector pos;
- TLorentzVector mom;
-
- static Float_t hits[14];
- static Float_t eloss;
-
- if ( gMC->TrackPid() != kMuonMinus ) return;
-
- // Only charged tracks
- if ( !(gMC->TrackCharge()) ) return;
-
- if (gMC->IsNewTrack()) {
- // Reset the deposited energy
- eloss = 0;
- }
-
- // Add th energy loss in each step.
- eloss += gMC->Edep();
-
- if ( ( (strcmp(gMC->CurrentVolName(),"ACORDE4") == 0) || // Magnet
- (strcmp(gMC->CurrentVolName(),"ACORDE5") == 0) || // ACORDE
- (strcmp(gMC->CurrentVolName(),"ACORDE6") == 0) || // Magnet Doors
- (strcmp(gMC->CurrentVolName(),"CSF2") == 0) || // PX24
- (strcmp(gMC->CurrentVolName(),"CSF3") == 0) || // PM25
- (strcmp(gMC->CurrentVolName(),"CSF4") == 0) ) // PGC2
- && gMC->IsTrackEntering() ) {
-
- /*
- if ( (strcmp(gMC->CurrentVolName(),"ACORDE3") == 0)
- && gMC->IsTrackEntering() ) {
- */
- // Get current particle id(ipart),track position (pos) and momentum (mom)
- gMC->TrackPosition(pos);
- gMC->TrackMomentum(mom);
- ipart = gMC->TrackPid();
-
- ipart = gMC->TrackPid();
- hits[0] = (Float_t)ipart; // (fId)
-
- hits[1] = pos[0]; // X coordinate (fX)
- hits[2] = pos[1]; // Y coordinate (fY)
- hits[3] = pos[2]; // Z coordinate (fZ)
- hits[4] = mom[0]; // Px (fpxug)
- hits[5] = mom[1]; // Py (fpyug)
- hits[6] = mom[2]; // Pz (fpzug)
- hits[7] = eloss; // Energy loss
-
- Info("StepManager", "X=%f", pos[0]);
-
- // Tag the volumes
- if ( (strcmp(gMC->CurrentVolName(),"ACORDE4")==0) ) vol[0] = 1; // Magnet
- else if ( (strcmp(gMC->CurrentVolName(),"ACORDE5")==0) ) vol[0] = 2; // ACORDE
- else if ( (strcmp(gMC->CurrentVolName(),"ACORDE6")==0) ) vol[0] = 3; // Doors
- else if ( (strcmp(gMC->CurrentVolName(),"CSF2")==0) ) vol[0] = 4; // PX24
- else if ( (strcmp(gMC->CurrentVolName(),"CSF3")==0) ) vol[0] = 5; // PM25
- else if ( (strcmp(gMC->CurrentVolName(),"CSF4")==0) ) vol[0] = 6; // PGC2
- else vol[0] = -1;// ?
- //vol[0] = gMC->GetMedium(); //layer(flay)
- Info("StepManager", "Adding hit");
- AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
- Info("StepManager", "Hit added");
- // Reset the deposited energy only when you reach the Magnet
- if ( (strcmp(gMC->CurrentVolName(),"ACORDE4")==0) ) eloss = 0;
-
- } else {
- return;
- }
-
-}
-
-//_____________________________________________________________________________
-void AliACORDEv1::AddHit(Int_t track, Int_t *vol, Float_t *hits)
-{
- //
- // Add a ACORDE hit
- //
- TClonesArray &lhits = *fHits;
- new(lhits[fNhits++]) AliACORDEhit(fIshunt,track,vol,hits);
-}
+++ /dev/null
-#ifndef ALIACORDEV1_H
-#define ALIACORDEV1_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-////////////////////////////////////////////////
-// Manager class for detector: ACORDEv1 //
-////////////////////////////////////////////////
-
-#include "AliACORDE.h"
-
-class AliACORDEv1 : public AliACORDE {
-public:
- AliACORDEv1();
- AliACORDEv1(const char *name, const char *title);
- virtual ~AliACORDEv1();
-
- virtual TString Version() { return TString("v1"); }
- virtual Int_t IsVersion() const { return 1; }
-
- virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits);
- //virtual void FinishEvent();
- //virtual void ResetHits();
- //virtual void ResetDigits();
-
- virtual void CreateMaterials();
- virtual void CreateGeometry();
-
- virtual void Init();
- virtual void DrawDetector() const;
- virtual void StepManager();
-
-protected:
- virtual void CreateMolasse();
- virtual void CreateShafts();
-
-private:
- AliACORDEv1(const AliACORDEv1& crt);
- AliACORDEv1& operator=(const AliACORDEv1& crt);
-
- ClassDef(AliACORDEv1, 1) //Class for ACORDE, version 1, Shafts outside of AliHALL
-};
-
-typedef AliACORDEv1 AliCRTv1; // for backward compatibility
-
-#endif // ALIACORDEV1_H
+++ /dev/null
-static Int_t eventsPerRun = 100;
-enum PprGeo_t
-{
- kHoles, kNoHoles
-};
-static PprGeo_t geo = kHoles;
-
-void Config()
-{
- // 7-DEC-2000 09:00
- // Switch on Transition Radiation simulation. 6/12/00 18:00
- // iZDC=1 7/12/00 09:00
- // ThetaRange is (0., 180.). It was (0.28,179.72) 7/12/00 09:00
- // Theta range given through pseudorapidity limits 22/6/2001
-
-
-
-
- // Set Random Number seed
- // gRandom->SetSeed(12345);
- TDatime dt;
- UInt_t curtime=dt.Get();
- UInt_t procid=gSystem->GetPid();
- UInt_t seed=curtime-procid;
- gRandom->SetSeed(seed);
- cerr<<"Seed for random number generation= "<<seed<<endl;
- cout<<"Seed for random number generation= "<<seed<<endl;
-
-
- new AliGeant3("C++ Interface to Geant3");
-
- if (!gSystem->Getenv("CONFIG_FILE"))
- {
- TFile *rootfile = new TFile("galice.root", "recreate");
-
- rootfile->SetCompressionLevel(2);
- }
-
- TGeant3 *geant3 = (TGeant3 *) gMC;
-
- //
- // Set External decayer
- AliDecayer *decayer = new AliDecayerPythia();
-
- decayer->SetForceDecay(kAll);
- decayer->Init();
- gMC->SetExternalDecayer(decayer);
- //
- //
- //=======================================================================
- // ******* GEANT STEERING parameters FOR ALICE SIMULATION *******
- geant3->SetTRIG(1); //Number of events to be processed
- geant3->SetSWIT(4, 10);
- geant3->SetDEBU(0, 0, 1);
- //geant3->SetSWIT(2,2);
- geant3->SetDCAY(1);
- geant3->SetPAIR(1);
- geant3->SetCOMP(1);
- geant3->SetPHOT(1);
- geant3->SetPFIS(0);
- geant3->SetDRAY(0);
- geant3->SetANNI(1);
- geant3->SetBREM(1);
- geant3->SetMUNU(1);
- geant3->SetCKOV(1);
- geant3->SetHADR(4); //Select pure GEANH (HADR 1) or GEANH/NUCRIN (HADR 3)
- geant3->SetLOSS(2);
- geant3->SetMULS(1);
- geant3->SetRAYL(1);
- geant3->SetAUTO(1); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
- geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
- geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
- geant3->SetERAN(5.e-7);
-
- Float_t cut = 1.e-3; // 1MeV cut by default
- Float_t tofmax = 1.e10;
-
- // GAM ELEC NHAD CHAD MUON EBREM MUHAB EDEL MUDEL MUPA TOFMAX
- geant3->SetCUTS(cut, cut, cut, cut, cut, cut, cut, cut, cut, cut,
- tofmax);
- //
- //=======================================================================
- // ************* STEERING parameters FOR ALICE SIMULATION **************
- // --- Specify event type to be tracked through the ALICE setup
- // --- All positions are in cm, angles in degrees, and P and E in GeV
- if (gSystem->Getenv("CONFIG_NPARTICLES"))
- {
- int nParticles = atoi(gSystem->Getenv("CONFIG_NPARTICLES"));
- } else
- {
- int nParticles = 50;
- }
-
- AliGenACORDE *gener = new AliGenACORDE(); // One generation per event
- //TF1* zenithFunc = new TF1("zenith","1/cos(x)", 0. 65.);
- //gener->SetZenithalDistributionFunction(zenithFunc);
- //Float_t tend = 65.*TMath::Pi()/180.;
- //TF1* momFunc = new TF1("momFunc", "x", 10., 1000.);
- //gener->SetMomentumDistrubutionFunction(momFunc);
- gener->SetZenithalAngleRange(0., 65.);
- gener->SetAzimuthalAngleRange(0., 359.);
- gener->SetMomentumResolution(1.); // GeVs
- gener->SetSigma(0,0,0); // Sigma for smearing
- gener->SetMomentumRange(10., 1000.); // in GeVs.
-
- gener->SetPart(kMuonMinus);
- // Two choices:
- // kMuonMinus
- // kMuonPlus
-
- //gener->SetMode(kSingleMuons);// Single muons
- //gener->SetMode(kMuonBundle);
- gener->SetMode(kMuonFlux);
- // three choises
- // kSingleMuons
- // kMuonBundle
- // kMuonFlux <- Not available, yet
-
- // If you choose kMuonBundle, you should set how many particles do you
- // want and in wich region should the muons be generated, for instance
- // if you want to generate n^2 muons, in a square of side 300 cm
- //gener->SetRange(4, 300., 4, 300.);
-
- //gener->SetVertexSmear(kPerEvent); // Set the smearing per Event
-
- gener->Init(); // Intialize the generator.
-
- // Set the tracking limits to include the Molasse
- gAlice->TrackingLimits( 5000, 5000);
-
- //
- // Activate this line if you want the vertex smearing to happen
- // track by track
- //
- //gener->SetVertexSmear(perTrack);
- // Field (L3 0.4 T)
- AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., 1);
- rootfile->cd();
- gAlice->SetField(field);
-
-
- Int_t iABSO = 0;
- Int_t iDIPO = 0;
- Int_t iFMD = 0;
- Int_t iFRAME = 0;
- Int_t iHALL = 0;
- Int_t iITS = 0;
- Int_t iMAG = 0;
- Int_t iMUON = 0;
- Int_t iPHOS = 0;
- Int_t iPIPE = 0;
- Int_t iPMD = 0;
- Int_t iHMPID = 0;
- Int_t iSHIL = 0;
- Int_t iT0 = 0;
- Int_t iTOF = 0;
- Int_t iTPC = 0;
- Int_t iTRD = 0;
- Int_t iZDC = 0;
- Int_t iEMCAL = 0;
- Int_t iACORDE = 1;
- Int_t iVZERO = 0;
-
- //=================== Alice BODY parameters =============================
- AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
-
- if (iMAG)
- {
- //=================== MAG parameters ============================
- // --- Start with Magnet since detector layouts may be depending ---
- // --- on the selected Magnet dimensions ---
- AliMAG *MAG = new AliMAG("MAG", "Magnet");
- }
-
-
- if (iABSO)
- {
- //=================== ABSO parameters ============================
- AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
- }
-
- if (iDIPO)
- {
- //=================== DIPO parameters ============================
-
- AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
- }
-
- if (iHALL)
- {
- //=================== HALL parameters ============================
-
- AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
- }
-
-
- if (iFRAME)
- {
- //=================== FRAME parameters ============================
-
- AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
- if (geo == kHoles) {
- FRAME->SetHoles(1);
- } else {
- FRAME->SetHoles(0);
- }
- }
-
- if (iSHIL)
- {
- //=================== SHIL parameters ============================
-
- AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
- }
-
-
- if (iPIPE)
- {
- //=================== PIPE parameters ============================
-
- AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
- }
-
- if(iITS) {
-
- //=================== ITS parameters ============================
- //
- // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
- // almost all other detectors. This involves the fact that the ITS geometry
- // still has several options to be followed in parallel in order to determine
- // the best set-up which minimizes the induced background. All the geometries
- // available to date are described in the following. Read carefully the comments
- // and use the default version (the only one uncommented) unless you are making
- // comparisons and you know what you are doing. In this case just uncomment the
- // ITS geometry you want to use and run Aliroot.
- //
- // Detailed geometries:
- //
- //
- //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
- //
- //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
- //
- AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
- ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
- ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
- // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
- ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
- ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
- ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
- ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
- ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
- ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
- //
- //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
- //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
- //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
- //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
- //ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
- //ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
- //ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [150,300]
- //ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [150,300]
- //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
- //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
- //
- //
- // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
- // for reconstruction !):
- //
- //
- //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
- //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
- //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
- //
- //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
- //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
- //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
- //
- //
- //
- // Geant3 <-> EUCLID conversion
- // ============================
- //
- // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
- // media to two ASCII files (called by default ITSgeometry.euc and
- // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
- // The default (=0) means that you dont want to use this facility.
- //
- ITS->SetEUCLID(0);
- }
-
- if (iTPC)
- {
- //============================ TPC parameters ================================
- // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
- // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
- // --- sectors are specified, any value other than that requires at least one
- // --- sector (lower or upper)to be specified!
- // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
- // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
- // --- SecLows - number of lower sectors specified (up to 6)
- // --- SecUps - number of upper sectors specified (up to 12)
- // --- Sens - sensitive strips for the Slow Simulator !!!
- // --- This does NOT work if all S or L-sectors are specified, i.e.
- // --- if SecAL or SecAU < 0
- //
- //
- //-----------------------------------------------------------------------------
-
- // gROOT->LoadMacro("SetTPCParam.C");
- // AliTPCParam *param = SetTPCParam();
- AliTPC *TPC = new AliTPCv2("TPC", "Default");
-
- // All sectors included
- TPC->SetSecAL(-1);
- TPC->SetSecAU(-1);
-
- }
-
-
- if (iTOF) {
- if (geo == kHoles) {
- //=================== TOF parameters ============================
- AliTOF *TOF = new AliTOFv2FHoles("TOF", "TOF with Holes");
- } else {
- AliTOF *TOF = new AliTOFv4T0("TOF", "normal TOF");
- }
- }
-
-
- if (iHMPID)
- {
- //=================== HMPID parameters ===========================
- AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
-
- }
-
-
- if (iZDC)
- {
- //=================== ZDC parameters ============================
-
- AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
- }
-
- if (iTRD)
- {
- //=================== TRD parameters ============================
-
- AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
-
- // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
- TRD->SetGasMix(1);
- if (geo == kHoles) {
- // With hole in front of PHOS
- TRD->SetPHOShole();
- // With hole in front of HMPID
- TRD->SetHMPIDhole();
- }
- // Switch on TR
- AliTRDsim *TRDsim = TRD->CreateTR();
- }
-
- if (iFMD)
- {
- //=================== FMD parameters ============================
- AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
- FMD->SetRingsSi1(256);
- FMD->SetRingsSi2(128);
- FMD->SetSectorsSi1(20);
- FMD->SetSectorsSi2(40);
- }
-
- if (iMUON)
- {
- //=================== MUON parameters ===========================
-
- AliMUON *MUON = new AliMUONv1("MUON", "default");
- }
- //=================== PHOS parameters ===========================
-
- if (iPHOS)
- {
- AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
- }
-
-
- if (iPMD)
- {
- //=================== PMD parameters ============================
- AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
- }
-
- if (iT0)
- {
- //=================== T0 parameters ============================
- AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
- }
-
- if (iEMCAL)
- {
- //=================== EMCAL parameters ============================
- AliEMCAL *EMCAL = new AliEMCALv1("EMCAL", "EMCALArch1a");
- }
-
- if (iACORDE)
- {
- //=================== ACORDE parameters ============================
- //AliACORDE *ACORDE = new AliACORDEv0("ACORDE", "normal ACORDE");
- AliACORDE* ACORDE = new AliACORDEv1("ACORDE", "Special version Only with the ACORDE");
- }
-
- if (iVZERO)
- {
- //=================== ACORDE parameters ============================
- AliVZERO *VZERO = new AliVZEROv2("VZERO", "normal VZERO");
- }
-
-}
-
-Float_t EtaToTheta(Float_t arg){
- return (180./TMath::Pi())*2.*atan(exp(-arg));
-}
+++ /dev/null
-void DrawACORDE()
-{
- gMC->Gsatt("*", "seen", -1);
- gMC->Gsatt("alic", "seen", 0);
- gROOT->LoadMacro("ViewACORDE.C");
- gInterpreter->ProcessLine("ViewACORDE()");
- //gMC->Gdopt("proj", "pers");
- gMC->Gdopt("hide", "on");
- gMC->Gdopt("shad", "on");
- gMC->Gsatt("*", "fill", 7);
- gMC->SetClipBox(".");
- gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000);
- gMC->DefaultRange();
- gMC->Gdraw("alic", 30, 40, 0, 10, 9.5, .0095, .0095);
- //gMC->Gdraw("alic", 30, 40, 0, -30, -60, .09, .09); //Zoom right side
- //gMC->Gdraw("alic", 30, 30, 0, 10, -10, .03, .03); // Zoom right side
- gMC->Gdhead(1111, "View of ACORDE (ACORDE)");
- gMC->Gdman(18, 4, "MAN");
-}
+++ /dev/null
-void ViewACORDE()
-{
- gMC->Gsatt("ALIC","seen",0);
-
- gMC->Gsatt("L3MO","seen",0); // L3 Magnet, Mother
- gMC->Gsatt("L3CO","seen",1); // Coils
- gMC->Gsatt("L3C1","seen",1); // Coils
- gMC->Gsatt("L3YO","seen",1); // Yoke
- gMC->Gsatt("L3DO","seen",0); // return Yoke (DOOR)
- gMC->Gsatt("L3FR","seen",1); // DOOR
- gMC->Gsatt("L3IR","seen",0); // Inner layer
- gMC->Gsatt("L3O1","seen",1); // Door opening
- gMC->Gsatt("L3O2","seen",1); // Door opening
-
- gMC->Gsatt("ACORDE1", "seen", 0); // ACORDE Mother
- gMC->Gsatt("ACORDE2", "seen", 0); // Module air box
- gMC->Gsatt("ACORDE3", "seen", 1); // Scintillators
- gMC->Gsatt("ACORDE3", "colo", 2); // Scintillators
- gMC->Gsatt("ACORDE4", "seen", 1); // Aluminium frame (long bars)
- gMC->Gsatt("ACORDE4", "colo", 3); //
- gMC->Gsatt("ACORDE5", "seen", 1); // Aluminium frame (short bars)
- gMC->Gsatt("ACORDE5", "colo", 3); //
- gMC->Gsatt("ACORDE6", "seen", 1); // Module support
- gMC->Gsatt("ACORDE6", "colo", 3); //
-}
-SRCS = AliACORDE.cxx AliACORDEConstants.cxx AliACORDEModule.cxx \
- AliGenACORDE.cxx AliACORDEhit.cxx AliACORDEdigit.cxx \
- AliACORDEPreprocessor.cxx AliACORDECalibModule.cxx \
- AliACORDEDataModule.cxx
+SRCS = AliACORDE.cxx AliACORDEConstants.cxx AliACORDECalibData.cxx \
+ AliGenACORDE.cxx AliACORDELoader.cxx
HDRS:= $(SRCS:.cxx=.h)
-SRCS = AliACORDEv0.cxx AliACORDEv1.cxx
+SRCS = AliACORDEv0.cxx AliACORDEhit.cxx AliACORDEdigit.cxx \
+ AliACORDEDigitizer.cxx AliACORDETrigger.cxx \
+ AliACORDERawData.cxx
HDRS:= $(SRCS:.cxx=.h)
--- /dev/null
+//
+
+// Configuration for the Physics Data Challenge 2006
+
+//
+
+
+
+// One can use the configuration macro in compiled mode by
+
+// root [0] gSystem->Load("libgeant321");
+
+// root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
+
+// -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
+
+// root [0] .x grun.C(1,"Config_PDC06.C++")
+
+
+
+#if !defined(__CINT__) || defined(__MAKECINT__)
+
+#include <Riostream.h>
+
+#include <TRandom.h>
+
+#include <TDatime.h>
+
+#include <TSystem.h>
+
+#include <TVirtualMC.h>
+
+#include <TGeant3TGeo.h>
+
+#include "EVGEN/AliGenCocktail.h"
+
+#include "EVGEN/AliGenParam.h"
+
+#include "EVGEN/AliGenMUONlib.h"
+
+#include "STEER/AliRunLoader.h"
+
+#include "STEER/AliRun.h"
+
+#include "STEER/AliConfig.h"
+
+#include "PYTHIA6/AliDecayerPythia.h"
+
+#include "PYTHIA6/AliGenPythia.h"
+
+#include "STEER/AliMagFMaps.h"
+
+#include "STRUCT/AliBODY.h"
+
+#include "STRUCT/AliMAG.h"
+
+#include "STRUCT/AliABSOv0.h"
+
+#include "STRUCT/AliDIPOv2.h"
+
+#include "STRUCT/AliHALL.h"
+
+#include "STRUCT/AliFRAMEv2.h"
+
+#include "STRUCT/AliSHILv2.h"
+
+#include "STRUCT/AliPIPEv0.h"
+
+#include "ITS/AliITSgeom.h"
+
+#include "ITS/AliITSvPPRasymmFMD.h"
+
+#include "TPC/AliTPCv2.h"
+
+#include "TOF/AliTOFv5T0.h"
+
+#include "HMPID/AliHMPIDv1.h"
+
+#include "ZDC/AliZDCv2.h"
+
+#include "TRD/AliTRDv1.h"
+
+#include "FMD/AliFMDv1.h"
+
+#include "MUON/AliMUONv1.h"
+
+#include "PHOS/AliPHOSv1.h"
+
+#include "PMD/AliPMDv1.h"
+
+#include "T0/AliT0v1.h"
+
+#include "EMCAL/AliEMCALv2.h"
+
+#include "CRT/AliCRTv0.h"
+
+#include "VZERO/AliVZEROv7.h"
+
+#endif
+
+
+
+//--- Trigger config ---
+
+enum TrigConf_t
+
+{
+
+ kDefaultPPTrig, kDefaultPbPbTrig
+
+};
+
+
+
+const char * TrigConfName[] = {
+
+ "p-p","Pb-Pb"
+
+};
+
+
+
+
+
+
+
+//--- Decay Mode ---
+
+enum DecayHvFl_t
+
+{
+
+ kNature, kHadr, kSemiEl, kSemiMu
+
+};
+
+//--- Rapidity Cut ---
+
+enum YCut_t
+
+{
+
+ kFull, kBarrel, kMuonArm
+
+};
+
+//--- Magnetic Field ---
+
+enum Mag_t
+
+{
+
+ k2kG, k4kG, k5kG
+
+};
+
+
+
+void ProcessEnvironmentVars();
+
+
+
+// This part for configuration
+
+static DecayHvFl_t decHvFl = kNature;
+
+static YCut_t ycut = kFull;
+
+static Mag_t mag = k5kG;
+
+static TrigConf_t trig = kDefaultPPTrig;
+
+//========================//
+
+// Set Random Number seed //
+
+//========================//
+
+TDatime dt;
+
+static UInt_t seed = dt.Get();
+
+
+
+
+
+// Comment line
+
+static TString comment;
+
+
+
+void Config()
+
+{
+
+
+
+
+
+ // Get settings from environment variables
+
+ ProcessEnvironmentVars();
+
+
+
+ gRandom->SetSeed(seed);
+
+ // gRandom->SetSeed(12345);
+
+ cerr<<"Seed for random number generation= "<<seed<<endl;
+
+
+
+ // libraries required by geant321
+
+#if defined(__CINT__)
+
+ gSystem->Load("libgeant321");
+
+#endif
+
+
+
+ new TGeant3TGeo("C++ Interface to Geant3");
+
+
+
+ //=======================================================================
+
+ // Create the output file
+
+
+
+
+
+ AliRunLoader* rl=0x0;
+
+
+
+ cout<<"Config.C: Creating Run Loader ..."<<endl;
+
+ rl = AliRunLoader::Open("galice.root",
+
+ AliConfig::GetDefaultEventFolderName(),
+
+ "recreate");
+
+ if (rl == 0x0)
+
+ {
+
+ gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
+
+ return;
+
+ }
+
+ rl->SetCompressionLevel(2);
+
+ rl->SetNumberOfEventsPerFile(1000);
+
+ gAlice->SetRunLoader(rl);
+
+
+
+ // Set the trigger configuration
+
+ gAlice->SetTriggerDescriptor(TrigConfName[trig]);
+
+ cout<<"Trigger configuration is set to "<<TrigConfName[trig]<<endl;
+
+
+
+ //
+
+ //=======================================================================
+
+ // ************* STEERING parameters FOR ALICE SIMULATION **************
+
+ // --- Specify event type to be tracked through the ALICE setup
+
+ // --- All positions are in cm, angles in degrees, and P and E in GeV
+
+
+
+
+
+ gMC->SetProcess("DCAY",1);
+
+ gMC->SetProcess("PAIR",1);
+
+ gMC->SetProcess("COMP",1);
+
+ gMC->SetProcess("PHOT",1);
+
+ gMC->SetProcess("PFIS",0);
+
+ gMC->SetProcess("DRAY",0);
+
+ gMC->SetProcess("ANNI",1);
+
+ gMC->SetProcess("BREM",1);
+
+ gMC->SetProcess("MUNU",1);
+
+ gMC->SetProcess("CKOV",1);
+
+ gMC->SetProcess("HADR",1);
+
+ gMC->SetProcess("LOSS",2);
+
+ gMC->SetProcess("MULS",1);
+
+ gMC->SetProcess("RAYL",1);
+
+
+
+ Float_t cut = 1.e-3; // 1MeV cut by default
+
+ Float_t tofmax = 1.e10;
+
+
+
+ gMC->SetCut("CUTGAM", cut);
+
+ gMC->SetCut("CUTELE", cut);
+
+ gMC->SetCut("CUTNEU", cut);
+
+ gMC->SetCut("CUTHAD", cut);
+
+ gMC->SetCut("CUTMUO", cut);
+
+ gMC->SetCut("BCUTE", cut);
+
+ gMC->SetCut("BCUTM", cut);
+
+ gMC->SetCut("DCUTE", cut);
+
+ gMC->SetCut("DCUTM", cut);
+
+ gMC->SetCut("PPCUTM", cut);
+
+ gMC->SetCut("TOFMAX", tofmax);
+
+ // ((TGeant3 *) gMC)->SetSWIT(2,2);
+
+ // ((TGeant3 *) gMC)->SetDEBU(1,999,1);
+
+
+
+
+
+
+
+
+
+ // Set External decayer //
+
+ //======================//
+
+ TVirtualMCDecayer* decayer = new AliDecayerPythia();
+
+ // DECAYS
+
+ //
+
+ switch(decHvFl) {
+
+ case kNature:
+
+ decayer->SetForceDecay(kAll);
+
+ break;
+
+ case kHadr:
+
+ decayer->SetForceDecay(kHadronicD);
+
+ break;
+
+ case kSemiEl:
+
+ decayer->SetForceDecay(kSemiElectronic);
+
+ break;
+
+ case kSemiMu:
+
+ decayer->SetForceDecay(kSemiMuonic);
+
+ break;
+
+ }
+
+ decayer->Init();
+
+ gMC->SetExternalDecayer(decayer);
+
+
+
+ //=========================//
+
+ // Generator Configuration //
+
+ //=========================//
+
+ AliGenBox* gener = new AliGenBox();
+
+ gener->SetThetaRange(45,135);
+
+ gener->SetPhiRange(30,150);
+
+ gener->SetMomentumRange(9.8,10.2);
+
+ gener->SetPart(kMuonMinus);
+
+ gener->SetNumberParticles(20);
+
+
+
+
+
+ gener->Init();
+
+
+
+ // FIELD
+
+ //
+
+ if (mag == k2kG) {
+
+ comment = comment.Append(" | L3 field 0.2 T");
+
+ } else if (mag == k4kG) {
+
+ comment = comment.Append(" | L3 field 0.4 T");
+
+ } else if (mag == k5kG) {
+
+ comment = comment.Append(" | L3 field 0.5 T");
+
+ }
+
+ printf("\n \n Comment: %s \n \n", comment.Data());
+
+
+
+ AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
+
+ field->SetL3ConstField(0); //Using const. field in the barrel
+
+ rl->CdGAFile();
+
+ gAlice->SetField(field);
+
+
+
+
+
+
+
+ Int_t iABSO = 0;
+
+ Int_t iACORDE = 1;
+
+ Int_t iDIPO = 0;
+
+ Int_t iEMCAL = 0;
+
+ Int_t iFMD = 0;
+
+ Int_t iFRAME = 0;
+
+ Int_t iHALL = 0;
+
+ Int_t iITS = 0;
+
+ Int_t iMAG = 0;
+
+ Int_t iMUON = 0;
+
+ Int_t iPHOS = 0;
+
+ Int_t iPIPE = 0;
+
+ Int_t iPMD = 0;
+
+ Int_t iHMPID = 0;
+
+ Int_t iSHIL = 0;
+
+ Int_t iT0 = 0;
+
+ Int_t iTOF = 0;
+
+ Int_t iTPC = 0;
+
+ Int_t iTRD = 0;
+
+ Int_t iVZERO = 0;
+
+ Int_t iZDC = 0;
+
+
+
+
+
+ //=================== Alice BODY parameters =============================
+
+ AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
+
+
+
+
+
+ if (iMAG)
+
+ {
+
+ //=================== MAG parameters ============================
+
+ // --- Start with Magnet since detector layouts may be depending ---
+
+ // --- on the selected Magnet dimensions ---
+
+ AliMAG *MAG = new AliMAG("MAG", "Magnet");
+
+ }
+
+
+
+
+
+ if (iABSO)
+
+ {
+
+ //=================== ABSO parameters ============================
+
+ AliABSO *ABSO = new AliABSOv0("ABSO", "Muon Absorber");
+
+ }
+
+
+
+ if (iDIPO)
+
+ {
+
+ //=================== DIPO parameters ============================
+
+
+
+ AliDIPO *DIPO = new AliDIPOv2("DIPO", "Dipole version 2");
+
+ }
+
+
+
+ if (iHALL)
+
+ {
+
+ //=================== HALL parameters ============================
+
+
+
+ AliHALL *HALL = new AliHALL("HALL", "Alice Hall");
+
+ }
+
+
+
+
+
+ if (iFRAME)
+
+ {
+
+ //=================== FRAME parameters ============================
+
+
+
+ AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
+
+ }
+
+
+
+ if (iSHIL)
+
+ {
+
+ //=================== SHIL parameters ============================
+
+
+
+ AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
+
+ }
+
+
+
+
+
+ if (iPIPE)
+
+ {
+
+ //=================== PIPE parameters ============================
+
+
+
+ AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
+
+ }
+
+
+
+ if(iITS) {
+
+
+
+ //=================== ITS parameters ============================
+
+ //
+
+ // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
+
+ // almost all other detectors. This involves the fact that the ITS geometry
+
+ // still has several options to be followed in parallel in order to determine
+
+ // the best set-up which minimizes the induced background. All the geometries
+
+ // available to date are described in the following. Read carefully the comments
+
+ // and use the default version (the only one uncommented) unless you are making
+
+ // comparisons and you know what you are doing. In this case just uncomment the
+
+ // ITS geometry you want to use and run Aliroot.
+
+ //
+
+ // Detailed geometries:
+
+ //
+
+ //
+
+ //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
+
+ //
+
+ //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
+
+ //
+
+ AliITSvPPRasymmFMD *ITS = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
+
+ ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
+
+ ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
+
+ // ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
+
+ ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [100,300]
+
+ ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [100,300]
+
+ ITS->SetThicknessChip1(150.); // chip thickness on layer 1 must be in the range [150,300]
+
+ ITS->SetThicknessChip2(150.); // chip thickness on layer 2 must be in the range [150,300]
+
+ ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
+
+ ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
+
+
+
+ // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
+
+ // for reconstruction !):
+
+ //
+
+ //
+
+ //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
+
+ //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
+
+ //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
+
+ //
+
+ //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
+
+ //ITS->SetRails(0); // 1 --> rails in ; 0 --> rails out
+
+ //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
+
+ //
+
+ //
+
+ //
+
+ // Geant3 <-> EUCLID conversion
+
+ // ============================
+
+ //
+
+ // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
+
+ // media to two ASCII files (called by default ITSgeometry.euc and
+
+ // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
+
+ // The default (=0) means that you dont want to use this facility.
+
+ //
+
+ ITS->SetEUCLID(0);
+
+ }
+
+
+
+ if (iTPC)
+
+ {
+
+ //============================ TPC parameters =====================
+
+ AliTPC *TPC = new AliTPCv2("TPC", "Default");
+
+ }
+
+
+
+
+
+ if (iTOF) {
+
+ //=================== TOF parameters ============================
+
+ AliTOF *TOF = new AliTOFv5T0("TOF", "normal TOF");
+
+ // Partial geometry: modules at 2,3,4,6,7,11,12,14,15,16
+
+ // starting at 6h in positive direction
+
+ // Int_t TOFSectors[18]={-1,-1,0,0,0,-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0};
+
+ // Partial geometry: modules at 1,2,6,7,9,10,11,12,15,16,17
+
+ // (ALICE numbering convention)
+
+ Int_t TOFSectors[18]={-1,0,0,-1,-1,-1,0,0,-1,0,0,0,0,-1,-1,0,0,0};
+
+ TOF->SetTOFSectors(TOFSectors);
+
+ }
+
+
+
+
+
+ if (iHMPID)
+
+ {
+
+ //=================== HMPID parameters ===========================
+
+ AliHMPID *HMPID = new AliHMPIDv1("HMPID", "normal HMPID");
+
+
+
+ }
+
+
+
+
+
+ if (iZDC)
+
+ {
+
+ //=================== ZDC parameters ============================
+
+
+
+ AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
+
+ }
+
+
+
+ if (iTRD)
+
+ {
+
+ //=================== TRD parameters ============================
+
+
+
+ AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
+
+ AliTRDgeometry *geoTRD = TRD->GetGeometry();
+
+ // Partial geometry: modules at 2,3,4,6,11,12,14,15
+
+ // starting at 6h in positive direction
+
+ geoTRD->SetSMstatus(0,0);
+
+ geoTRD->SetSMstatus(1,0);
+
+ geoTRD->SetSMstatus(5,0);
+
+ geoTRD->SetSMstatus(7,0);
+
+ geoTRD->SetSMstatus(8,0);
+
+ geoTRD->SetSMstatus(9,0);
+
+ geoTRD->SetSMstatus(10,0);
+
+ geoTRD->SetSMstatus(13,0);
+
+ geoTRD->SetSMstatus(16,0);
+
+ geoTRD->SetSMstatus(17,0);
+
+ }
+
+
+
+ if (iFMD)
+
+ {
+
+ //=================== FMD parameters ============================
+
+ AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
+
+ }
+
+
+
+ if (iMUON)
+
+ {
+
+ //=================== MUON parameters ===========================
+
+ // New MUONv1 version (geometry defined via builders)
+
+ AliMUON *MUON = new AliMUONv1("MUON", "default");
+
+ }
+
+ //=================== PHOS parameters ===========================
+
+
+
+ if (iPHOS)
+
+ {
+
+ AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
+
+ }
+
+
+
+
+
+ if (iPMD)
+
+ {
+
+ //=================== PMD parameters ============================
+
+ AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
+
+ }
+
+
+
+ if (iT0)
+
+ {
+
+ //=================== T0 parameters ============================
+
+ AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
+
+ }
+
+
+
+ if (iEMCAL)
+
+ {
+
+ //=================== EMCAL parameters ============================
+
+ AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH_77_TRD1_2X2_FINAL_110DEG");
+
+ }
+
+
+
+ if (iACORDE)
+
+ {
+
+ //=================== ACORDE parameters ============================
+
+ AliACORDE *ACORDE = new AliACORDEv0("ACORDE", "normal ACORDE");
+
+ // ACORDE->SetITSGeometry(kTRUE);
+
+ // ACORDE->SetCreateCavern(kFALSE);
+
+ }
+
+
+
+ if (iVZERO)
+
+ {
+
+ //=================== VZERO parameters =============================
+
+ AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
+
+ }
+
+}
+
+
+
+void ProcessEnvironmentVars()
+
+{
+
+ // Run type
+
+ if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
+
+ for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
+
+ if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
+
+ proc = (PDC06Proc_t)iRun;
+
+ cout<<"Run type set to "<<pprRunName[iRun]<<endl;
+
+ }
+
+ }
+
+ }
+
+
+
+ // Random Number seed
+
+ if (gSystem->Getenv("CONFIG_SEED")) {
+
+ seed = atoi(gSystem->Getenv("CONFIG_SEED"));
+
+ }
+
+}
+
+
+
+
+
+
+
--- /dev/null
+void DBStorageCalib(){
+
+AliCDBManager *man = AliCDBManager::Instance();
+
+AliCDBStorage *storLoc;
+man->SetDefaultStorage("local://$ALICE_ROOT");
+
+
+AliACORDECalibData *calibda = new AliACORDECalibData("Calib");
+
+Float_t Efficiencies[60] = {
+ 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+ 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+ 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+ 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+ 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+ 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94
+};
+Float_t Rates[60] = {
+
+ 1.14, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+ 1.14, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+ 1.14, 0.94, 0.94, 0.94, 0.94, 1.94, 0.94, 0.94, 0.94, 0.94,
+ 1.14, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+ 1.94, 0.94, 0.94, 0.94, 1.94, 0.94, 0.94, 0.94, 0.94, 0.94,
+ 0.94, 0.94, 0.94, 0.94, 1.94, 0.94, 0.94, 0.94, 0.94, 0.94
+
+
+ };
+
+calibda->SetEfficiencies(Efficiencies);
+calibda->SetRates(Rates);
+
+// Creation of the object ACORDE Calibration as a MetaData
+
+TObjString str("ACORDE Calibration"); // object that will be stored
+
+AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
+
+AliCDBId id("ACORDE/Calib/Data",0,9999999);
+
+md->SetResponsible("ACORDE team");
+md->SetBeamPeriod(0);
+md->SetAliRootVersion("v4-05-Release");
+md->SetComment("Prototype");
+md->PrintMetaData();
+
+storLoc = man->GetDefaultStorage();
+storLoc->Put(calibda, id, md);
+
+storLoc->Delete();
+delete md;
+
+}
+
--- /dev/null
+
+void ReadACORDEDigits()
+
+{
+
+ // get run loader loader
+ AliRunLoader* rl =
+ AliRunLoader::Open("galice.root",
+ AliConfig::GetDefaultEventFolderName(),"read");
+ if (rl == 0x0) {
+ cerr<<"Can not open session for file galice.root\n";
+ return;
+ }
+
+ rl->LoadgAlice();
+ gAlice = rl->GetAliRun();
+
+ // get acorde loader
+ AliACORDE* acorde = (AliACORDE*)gAlice->GetDetector("ACORDE");
+ AliLoader* aloader =rl->GetLoader("ACORDELoader");
+
+ // loop over events
+ Int_t nevt = rl->GetNumberOfEvents();
+ cout << " There are " << nevt << " evts " << endl;
+ for (Int_t ievt=0; ievt<nevt;ievt++) {
+ rl->GetEvent(ievt);
+ aloader->LoadDigits("READ");
+ TTree* treeD = aloader->TreeD();
+ TClonesArray *adigits = new TClonesArray ("AliACORDEdigit", 1000);
+ treeD->GetBranch("ACORDEdigit")->SetAddress(&adigits);
+
+ // loop over entries
+ Int_t nent = treeD->GetEntries();
+ cout << " There are " << nent << " entries in event " << ievt << endl;
+
+ for (Int_t ient=0;ient<nent;ient++) {
+ acorde->ResetDigits();
+ treeD->GetEvent(ient);
+ Int_t ndig = adigits->GetEntriesFast();
+ cout << " There are " << ndig << " digits in entry " << ient << endl;
+ for (Int_t idig=0;idig<ndig;idig++) {
+ AliACORDEdigit* digit = (AliACORDEdigit*) adigits->At(idig);
+ Int_t mod = digit->GetModule();
+ Float_t time = digit->GetTime();
+ cout << " Digit " << idig
+ <<" : module="<< mod << " time=" << time << endl;
+ for (Int_t i=0;i<3;i++)
+ cout << " track " << i << " is " << digit->GetTrack(i) << endl;
+ } // end loop over digits
+ } // end loop over entries
+ aloader->UnloadDigits();
+ } // end loop over events
+}
--- /dev/null
+void ReadACORDEHits (Int_t numberOfEvents=-1,
+ const char *filename="galice.root")
+
+ // produces some plots from acorde hits
+
+{
+ // Dynamically link some shared libs
+ if (gClassTable->GetID("AliRun") < 0)
+ {
+ gROOT->LoadMacro("loadlibs.C");
+ loadlibs();
+ }
+ if (gAlice)
+ {
+ delete gAlice->GetRunLoader();
+ delete gAlice;
+ gAlice = 0x0;
+ }
+
+ // get loaders
+ AliRunLoader *rl =
+ AliRunLoader::Open("galice.root",
+ AliConfig::GetDefaultEventFolderName(),"read");
+ if (!rl)
+ {
+ cerr<<"Can't load RunLoader from file! \n"; return 0x0;
+ }
+
+ rl->LoadgAlice();
+ gAlice = rl->GetAliRun();
+ if (!gAlice)
+ {
+ cerr << " AliRun object not found on file \n"; return 0x0;
+ }
+ rl->LoadHeader();
+
+
+ // Get the pointer to the ACORDE detector
+ AliLoader *acordel = rl->GetLoader("ACORDELoader");
+ AliACORDE *ACORDE = (AliACORDE *) gAlice->GetDetector("ACORDE");
+ if (ACORDE == 0x0 || acordel == 0x0) {
+ cerr << " Can not find ACORDE or ACORDELoader \n"; return 0x0;
+ }
+
+ // get number of events
+ if (numberOfEvents<0) numberOfEvents=(Int_t)(rl->GetNumberOfEvents());
+
+ //create histograms
+ TH1F *elossH = new TH1F("eloss" ,"Energy Loss ",1000,0.,10);
+ TH2F *geoH = new TH2F("geo"," ACORDE geometry seen by hits",
+ 250, -750,750, 250, -500,500);
+
+ for (Int_t ievent=0; ievent<numberOfEvents; ievent++) {
+ if ((ievent%10) == 0) printf ("Processing event %d \n", ievent);
+ rl->GetEvent(ievent);
+
+ // Get the pointer Hit tree
+ acordel->LoadHits();
+ TTree *hitTree = acordel->TreeH();
+ ACORDE->SetTreeAddress();
+ if (!hitTree) {
+ cout << " No TreeH found" << endl; return 0x0; //rc;
+ }
+
+ rl->LoadKinematics();
+ Int_t nTrack = (Int_t) hitTree->GetEntries();
+
+ // Start loop on tracks in the hits containers
+ for(Int_t iTrack=0; iTrack<nTrack;iTrack++){
+ ACORDE->ResetHits();
+ hitTree->GetEvent(iTrack);
+ if(ACORDE) {
+ for(acordeHit=(AliACORDEhit*)ACORDE->FirstHit(-1);acordeHit;
+ acordeHit=(AliACORDEhit*)ACORDE->NextHit()) {
+ elossH->Fill( (Float_t)(acordeHit->Eloss()*1000.0));
+ geoH->Fill(acordeHit->X(),acordeHit->Z());
+ } // end for acordeHits
+ } // end if ACORDE
+ } // end for iTrack
+ }
+ // save histos in a root file
+ TFile *fout = new TFile("ACORDE_hits.root","RECREATE");
+ elossH->Write();
+ geoH->Write();
+ fout->Close();
+}
--- /dev/null
+void Simulate()
+{
+ AliSimulation sim;
+ sim.SetConfigFile("./Config.C");
+ //sim.SetMakeSDigits(" ");
+ // sim.SetMakeDigits("");
+ //sim.SetWriteRawData(" ");
+ TStopwatch w;
+ w.Start();
+ sim.Run(10);
+ w.Stop();
+ w.Print();
+}