* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDInput.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:42:40 2006
+ @brief FMD utility classes for reading FMD data
+*/
//___________________________________________________________________
//
// The classes defined here, are utility classes for reading in data
#include "AliFMD.h" // ALIFMD_H
#include "AliFMDHit.h" // ALIFMDHIT_H
#include "AliFMDDigit.h" // ALIFMDDigit_H
+#include "AliFMDSDigit.h" // ALIFMDDigit_H
#include "AliFMDRecPoint.h" // ALIFMDRECPOINT_H
#include "AliFMDRawReader.h" // ALIFMDRAWREADER_H
#include <AliESD.h>
#include <TGeoManager.h> // ROOT_TGeoManager
#include <TSystemDirectory.h> // ROOT_TSystemDirectory
#include <Riostream.h> // ROOT_Riostream
-
+#include <TFile.h> // ROOT_TFile
//____________________________________________________________________
ClassImp(AliFMDInput)
#if 0
fTreeD(0),
fTreeS(0),
fTreeR(0),
+ fTreeA(0),
fChainE(0),
fArrayE(0),
fArrayH(0),
fArrayS(0),
fArrayR(0),
fArrayA(0),
+ fGeoManager(0),
fTreeMask(0),
fIsInit(kFALSE)
{
fTreeD(0),
fTreeS(0),
fTreeR(0),
+ fTreeA(0),
fChainE(0),
fArrayE(0),
fArrayH(0),
fArrayS(0),
fArrayR(0),
fArrayA(0),
+ fGeoManager(0),
fTreeMask(0),
fIsInit(kFALSE)
{
// Optionally, get the ESD files
if (TESTBIT(fTreeMask, kESD)) {
fChainE = new TChain("esdTree");
- TSystemDirectory dir;
+ TSystemDirectory dir(".",".");
TList* files = dir.GetListOfFiles();
- TSystemFile* file;
+ TSystemFile* file = 0;
+ if (!files) {
+ AliError("No files");
+ return kFALSE;
+ }
files->Sort();
TIter next(files);
while ((file = static_cast<TSystemFile*>(next()))) {
AliAlignObjAngles* a = static_cast<AliAlignObjAngles*>(array->At(i));
if (!a->ApplyToGeometry()) {
AliWarning(Form("Failed to apply alignment to %s",
- a->GetVolPath()));
+ a->GetSymName()));
}
}
}
AliInfo("Getting FMD digits");
if (fFMDLoader->LoadDigits()) return kFALSE;
fTreeD = fFMDLoader->TreeD();
- if (!fArrayD) fArrayD = fFMD->Digits();
+ if (fTreeD) {
+ if (!fArrayD) fArrayD = fFMD->Digits();
+ }
+ else {
+ fArrayD = 0;
+ AliWarning(Form("Failed to load FMD Digits"));
+ }
}
// Possibly load FMD Sdigit information
if (TESTBIT(fTreeMask, kSDigits)) {
if (read <= 0) return kFALSE;
fESD = fMainESD->GetFMDData();
if (!fESD) return kFALSE;
+ TFile* f = fChainE->GetFile();
+ if (f) {
+ TObject* o = f->GetStreamerInfoList()->FindObject("AliFMDMap");
+ if (o) {
+ TStreamerInfo* info = static_cast<TStreamerInfo*>(o);
+ std::cout << "AliFMDMap class version read is "
+ << info->GetClassVersion() << std::endl;
+ }
+ }
+ // fESD->CheckNeedUShort(fChainE->GetFile());
}
// Possibly load FMD Digit information
if (TESTBIT(fTreeMask, kRaw)) {
if (TESTBIT(fTreeMask, kRecPoints))
if (!ProcessRecPoints()) return kFALSE;
if (TESTBIT(fTreeMask, kESD))
- if (!ProcessESD(fESD)) return kFALSE;
+ if (!ProcessESDs()) return kFALSE;
return kTRUE;
}
Bool_t
AliFMDInput::ProcessHits()
{
+ // Read the hit tree, and pass each hit to the member function
+ // ProcessHit.
if (!fTreeH) {
AliError("No hit tree defined");
return kFALSE;
return kTRUE;
}
+//____________________________________________________________________
+Bool_t
+AliFMDInput::ProcessESDs()
+{
+ // Process event summary data
+ if (!fESD) return kFALSE;
+ for (UShort_t det = 1; det <= 3; det++) {
+ Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
+ for (Char_t* rng = rings; *rng != '\0'; rng++) {
+ UShort_t nsec = (*rng == 'I' ? 20 : 40);
+ UShort_t nstr = (*rng == 'I' ? 512 : 256);
+ for (UShort_t sec = 0; sec < nsec; sec++) {
+ for (UShort_t str = 0; str < nstr; str++) {
+ Float_t eta = fESD->Eta(det,*rng,sec,str);
+ Float_t mult = fESD->Multiplicity(det,*rng,sec,str);
+ if (!fESD->IsAngleCorrected())
+ mult *= TMath::Abs(TMath::Cos(2.*TMath::ATan(TMath::Exp(-eta))));
+ if (!ProcessESD(det, *rng, sec, str, eta, mult)) continue;
+ }
+ }
+ }
+ }
+ return kTRUE;
+}
+
//____________________________________________________________________
Bool_t
AliFMDInput::End()
return retval;
}
-//====================================================================
-ClassImp(AliFMDInputHits)
-#if 0
- ;
-#endif
-
-
-//====================================================================
-ClassImp(AliFMDInputDigits)
-#if 0
- ;
-#endif
-
-//====================================================================
-ClassImp(AliFMDInputSDigits)
-#if 0
- ;
-#endif
-
-//====================================================================
-ClassImp(AliFMDInputRecPoints)
-#if 0
- ;
-#endif
//____________________________________________________________________
//