///////////////////////////////////////////////////////////////////////////////
#include <TClonesArray.h>
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
+#include <TStopwatch.h>
#include <TTree.h>
#include <TVirtualMC.h>
-#include <TGeoManager.h>
#include "AliACORDE.h"
#include "AliMagF.h"
#include "AliRun.h"
#include "AliACORDERawData.h"
+#include "AliACORDERawStream.h"
ClassImp(AliACORDE)
AliACORDE::AliACORDE()
: AliDetector(),
fCreateCavern(0),
- fITSGeometry(0)
+ f4CentralModulesGeometry(0)
{
//
// Default constructor
AliACORDE::AliACORDE(const char *name, const char *title)
: AliDetector(name, title),
fCreateCavern(kFALSE),
- fITSGeometry(kTRUE)
+ f4CentralModulesGeometry(kTRUE)
{
//
void AliACORDE::CreateMaterials()
{
// Magnatic field inside the pit
- Int_t isxfld = gAlice->Field()->Integ();
- Float_t sxmgmx = gAlice->Field()->Max();
+ Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+ Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
//Magnetic field above the Magnet.
Int_t xfield = 0; // no Magnetic field.
// 4. Write raw data
AliACORDERawData rawdata;
- rawdata.WriteACORDERawData(Modules);
+ rawdata.WriteACORDERawData(Modules,(ndig > 1));
}
//_____________________________________________________________________________
-void AliACORDE::AddAlignableVolumes() const
+Bool_t AliACORDE::Raw2SDigits(AliRawReader* rawReader)
{
//
- // Create entries for alignable volumes associating the symbolic volume
- // name with the corresponding volume path. Needs to be syncronized with
- // eventual changes in the geometry.
- //
- TString vpstr1 = "ALIC_1/ACORDE1_";
- TString snstr1="ACORDE/Array";
- TString volpath, symname;
-
- for(Int_t cnt=1; cnt<=3; cnt++){
- volpath = vpstr1;
- volpath += cnt;
- symname = snstr1;
- symname += cnt;
- if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
- AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname.Data(),volpath.Data()));
+ // Reads the raw data stream and exracts the digits
+ //
+ // Input:
+ // rawReader : pointer to the current AliRawReader
+ // Output:
+ //
+ // Created: 31 Jan 2008 Mario Sitta
+ //
+ TStopwatch timer;
+ timer.Start();
+
+ if(!fLoader) {
+ AliError("no ACORDE loader found");
+ return kFALSE;
}
+ TTree* treeD = fLoader->TreeD();
+ if(!treeD) {
+ fLoader->MakeTree("D");
+ treeD = fLoader->TreeD();
+ }
+
+ AliACORDEdigit digit;
+ AliACORDEdigit* pdigit = &digit;
+ const Int_t kBufferSize = 4000;
+
+ treeD->Branch("ACORDE", "AliACORDEdigit", &pdigit, kBufferSize);
+
+ // rawReader->Reset();
+ AliACORDERawStream* rawStream = new AliACORDERawStream(rawReader);
+
+ if (!rawStream->Next()) return kFALSE; // No ACORDE data found
+ /*
+ for(Int_t i=0; i<64; i++) {
+ new(pdigit) AliACORDEdigit(i, (Int_t)rawStream->GetADC(i), (Int_t)rawStream->GetTime(i));
+ treeD->Fill();
+ }
+ */
+ fLoader->WriteDigits("OVERWRITE");
+ fLoader->UnloadDigits();
+
+ delete rawStream;
+
+ timer.Stop();
+ timer.Print();
+
+ return kTRUE;
}
+
+//_____________________________________________________________________________