conversion, by introducing class AliFMDSSDigitizer.
#include "AliFMDRing.h" // ALIFMDRING_H
#include "AliFMDDigitizer.h" // ALIFMDDIGITIZER_H
#include "AliFMDSDigitizer.h" // ALIFMDSDIGITIZER_H
+// #define USE_SSDIGITIZER
+#ifdef USE_SSDIGITIZER
+# include "AliFMDSSDigitizer.h" // ALIFMDSDIGITIZER_H
+#endif
// #include "AliFMDGeometryBuilder.h"
#include "AliFMDRawWriter.h" // ALIFMDRAWWRITER_H
#include "AliFMDPoints.h" // ALIFMDPOINTS_H
// Set the TClonesArray to read hits into.
b->SetAddress(&fHits);
}
+//____________________________________________________________________
+void
+AliFMD::SetSDigitsAddressBranch(TBranch *b)
+{
+ // Set the TClonesArray to read hits into.
+ b->SetAddress(&fSDigits);
+}
//____________________________________________________________________
void
// count3 ADC count (a 10-bit word), or -1 if not used
//
TClonesArray& a = *(SDigitsArray());
+ // AliFMDDebug(0, ("Adding sdigit # %d", fNsdigits));
new (a[fNsdigits++])
AliFMDSDigit(detector, ring, sector, strip, edep,
// Create AliFMDDigit's from AliFMDHit's. This is done by making a
// AliFMDDigitizer, and executing that code.
//
+#if 0
Warning("Hits2Digits", "Try not to use this method.\n"
"Instead, use AliSimulator");
+#endif
AliRunDigitizer* manager = new AliRunDigitizer(1, 1);
manager->SetInputStream(0, "galice.root");
- manager->SetOutputFile("H2Dfile");
-
- /* AliDigitizer* dig =*/ CreateDigitizer(manager);
+ manager->SetOutputFile("H2Dfile.root");
+ new AliFMDDigitizer(manager);
manager->Exec("");
delete manager;
}
// Create AliFMDSDigit's from AliFMDHit's. This is done by creating
// an AliFMDSDigitizer object, and executing it.
//
+
+#if 0
+ Warning("Hits2SDigits", "Try not to use this method.\n"
+ "Instead, use AliSimulator");
+ // Create AliFMDSDigit's from AliFMDHit's. This is done by creating
+ // an AliFMDSDigitizer object, and executing it.
+ //
AliFMDSDigitizer* digitizer = new AliFMDSDigitizer("galice.root");
digitizer->Exec("");
delete digitizer;
+#endif
+ AliRunDigitizer* manager = new AliRunDigitizer(1, 1);
+ manager->SetInputStream(0, "galice.root");
+ // manager->SetOutputFile("H2Sfile.root");
+
+ new AliFMDSDigitizer(manager);
+ manager->Exec("");
+ // Hmm!
+ delete manager;
}
AliFMD::CreateDigitizer(AliRunDigitizer* manager) const
{
// Create a digitizer object
- AliFMDDigitizer* digitizer = new AliFMDDigitizer(manager);
+
+ /* This is what we probably _should_ do */
+ AliFMDBaseDigitizer* digitizer = 0;
+
+#ifdef USE_SSDIGITIZER
+ digitizer = new AliFMDSSDigitizer(manager);
+#else
+ /* This is what we actually do, and will work */
+ AliInfo("SDigit->Digit conversion not really supported, "
+ "doing Hit->Digit conversion instead");
+ digitizer = new AliFMDDigitizer(manager);
+#endif
+ return digitizer;
+}
+//____________________________________________________________________
+AliDigitizer*
+AliFMD::CreateSDigitizer(AliRunDigitizer* manager) const
+{
+ // Create a digitizer object
+ AliFMDSDigitizer* digitizer = new AliFMDSDigitizer(manager);
return digitizer;
}
/** Set the TClonesArray to read hits into.
@param b The branch to containn the hits */
virtual void SetHitsAddressBranch(TBranch *b);
+ /** Set the TClonesArray to read sdigits into.
+ @param b The branch to containn the sdigits */
+ virtual void SetSDigitsAddressBranch(TBranch *b);
/** Set branch address for the Hits, Digits, and SDigits Tree. */
virtual void SetTreeAddress();
/** Get the array of summable digits
@param manager Digitization manager
@return a newly allocated AliFMDDigitizer */
virtual AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const;
+ /** Create a digitizer object
+ @param manager Digitization manager
+ @return a newly allocated AliFMDSDigitizer */
+ virtual AliDigitizer* CreateSDigitizer(AliRunDigitizer* manager) const;
/** Create AliFMDDigit's from AliFMDHit's. This is done by creating
an AliFMDDigitizer object, and executing it. */
virtual void Hits2Digits();
// #include <AliRunDigitizer.h> // ALIRUNDIGITIZER_H
//#include <AliRun.h> // ALIRUN_H
#include <AliLoader.h> // ALILOADER_H
+#include <AliRun.h> // ALILOADER_H
#include <AliRunLoader.h> // ALIRUNLOADER_H
//====================================================================
AliFMDMap::kMaxStrips),
fShapingTime(6)
{
+ AliFMDDebug(1, ("Constructed"));
// Default ctor - don't use it
}
fShapingTime(6)
{
// Normal CTOR
- AliFMDDebug(1, (" processed"));
+ AliFMDDebug(1, ("Constructed"));
SetShapingTime();
}
fShapingTime(6)
{
// Normal CTOR
- AliFMDDebug(1, (" processed"));
+ AliFMDDebug(1, (" Constructed"));
SetShapingTime();
}
AliFMDParameters::Instance()->Print("ALL");
return kTRUE;
}
-
+
+//____________________________________________________________________
+void
+AliFMDBaseDigitizer::Exec(Option_t* /*option*/)
+{
+ AliFMDDebug(1, ("Executing digitizer"));
+ AliFMD* fmd = 0;
+ AliLoader* outFMD = 0;
+ if (!SetupLoaders(fmd, outFMD)) return;
+ if (!LoopOverInput(fmd)) return;
+
+ // Digitize the event
+ DigitizeHits(fmd);
+
+ // Make the output
+ AliFMDDebug(5, ("Calling output tree"));
+ OutputTree(outFMD, fmd);
+}
+
+
+//____________________________________________________________________
+Bool_t
+AliFMDBaseDigitizer::SetupLoaders(AliFMD*& fmd, AliLoader*& outFMD)
+{
+ // Set-up input/output loaders.
+ AliFMDDebug(5, ("Setting up run-loaders"));
+
+ // Get the output manager and the FMD output manager
+ TString outFolder(fManager->GetOutputFolderName());
+ AliRunLoader* out = AliRunLoader::GetRunLoader(outFolder.Data());
+ outFMD = out->GetLoader("FMDLoader");
+ if (!outFMD) {
+ AliError("Cannot get the FMDLoader output folder");
+ return kFALSE;
+ }
+
+ // Get the input loader
+ TString inFolder(fManager->GetInputFolderName(0));
+ fRunLoader = AliRunLoader::GetRunLoader(inFolder.Data());
+ if (!fRunLoader) {
+ AliError("Can not find Run Loader for input stream 0");
+ return kFALSE;
+ }
+
+ // Get the AliRun object
+ if (!fRunLoader->GetAliRun()) {
+ AliWarning("Loading gAlice");
+ fRunLoader->LoadgAlice();
+ }
+
+ // Get the AliRun object
+ AliRun* run = fRunLoader->GetAliRun();
+ if (!run) {
+ AliError("Can not get Run from Run Loader");
+ return kFALSE;
+ }
+
+ // Get the AliFMD object
+ fmd = static_cast<AliFMD*>(run->GetDetector("FMD"));
+ if (!fmd) {
+ AliError("Can not get FMD from gAlice");
+ return kFALSE;
+ }
+ return kTRUE;
+}
+
+//____________________________________________________________________
+Bool_t
+AliFMDBaseDigitizer::LoopOverInput(AliFMD* fmd)
+{
+ if (!fManager) {
+ AliError("No digitisation manager defined");
+ return kFALSE;
+ }
+
+ Int_t nFiles= fManager->GetNinputs();
+ AliFMDDebug(1, (" Digitizing event number %d, got %d inputs",
+ fManager->GetOutputEventNr(), nFiles));
+ for (Int_t inputFile = 0; inputFile < nFiles; inputFile++) {
+ AliFMDDebug(5, ("Now reading input # %d", inputFile));
+ // Get the current loader
+ fRunLoader =
+ AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile));
+ if (!fRunLoader) {
+ Error("Exec", Form("no run loader for input file # %d", inputFile));
+ return kFALSE;
+ }
+ // Cache contriutions
+ AliFMDDebug(5, ("Now summing the contributions from input # %d",inputFile));
+ SumContributions(fmd);
+ }
+ return kTRUE;
+}
+
//____________________________________________________________________
UShort_t
// Get the FMD loader
AliLoader* inFMD = fRunLoader->GetLoader("FMDLoader");
// And load the hits
+ AliFMDDebug(5, ("Will read hits"));
inFMD->LoadHits("READ");
// Get the tree of hits
+ AliFMDDebug(5, ("Will get hit tree"));
TTree* hitsTree = inFMD->TreeH();
if (!hitsTree) {
// Try again
+ AliFMDDebug(5, ("First attempt failed, try again"));
inFMD->LoadHits("READ");
hitsTree = inFMD->TreeH();
}
// Get the FMD branch
+ AliFMDDebug(5, ("Will now get the branch"));
TBranch* hitsBranch = hitsTree->GetBranch("FMD");
if (hitsBranch) fmd->SetHitsAddressBranch(hitsBranch);
else AliFatal("Branch FMD hit not found");
// Get a list of hits from the FMD manager
+ AliFMDDebug(5, ("Get array of FMD hits"));
TClonesArray *fmdHits = fmd->Hits();
// Get number of entries in the tree
+ AliFMDDebug(5, ("Get # of tracks"));
Int_t ntracks = Int_t(hitsTree->GetEntries());
+ AliFMDDebug(5, ("We got %d tracks", ntracks));
AliFMDParameters* param = AliFMDParameters::Instance();
Int_t read = 0;
UShort_t sector = fmdHit->Sector();
UShort_t strip = fmdHit->Strip();
Float_t edep = fmdHit->Edep();
- // UShort_t minstrip = param->GetMinStrip(detector, ring, sector, strip);
- // UShort_t maxstrip = param->GetMaxStrip(detector, ring, sector, strip);
- // Check if strip is `dead'
- AliFMDDebug(2, ("Hit in FMD%d%c[%2d,%3d]=%f",
+ AliFMDDebug(10, ("Hit in FMD%d%c[%2d,%3d]=%f",
detector, ring, sector, strip, edep));
+ // Check if strip is `dead'
if (param->IsDead(detector, ring, sector, strip)) {
AliFMDDebug(1, ("FMD%d%c[%2d,%3d] is marked as dead",
detector, ring, sector, strip));
continue;
}
+ // UShort_t minstrip = param->GetMinStrip(detector, ring, sector, strip);
+ // UShort_t maxstrip = param->GetMaxStrip(detector, ring, sector, strip);
// Check if strip is out-side read-out range
// if (strip < minstrip || strip > maxstrip) {
// AliFMDDebug(5, ("FMD%d%c[%2d,%3d] is outside range [%3d,%3d]",
// Add this to the energy deposited for this strip
} // hit loop
} // track loop
- AliFMDDebug(1, ("Size of cache: %d bytes, read %d bytes",
+ AliFMDDebug(5, ("Size of cache: %d bytes, read %d bytes",
sizeof(fEdep), read));
+ inFMD->UnloadHits();
}
//____________________________________________________________________
// the energy signal to ADC counts, and store the created digit in
// the digits array (AliFMD::fDigits)
//
+ AliFMDDebug(5, ("Will now digitize all the summed signals"));
AliFMDGeometry* geometry = AliFMDGeometry::Instance();
TArrayI counts(4);
Float_t a = edep * convF + ped;
if (a < 0) a = 0;
counts[0] = UShort_t(TMath::Min(a, Float_t(maxAdc)));
- AliFMDDebug(2, ("FMD%d%c[%2d,%3d]: converting ELoss %f to "
+ AliFMDDebug(10, ("FMD%d%c[%2d,%3d]: converting ELoss %f to "
"ADC %4d (%f,%d)",
detector,ring,sector,strip,edep,counts[0],convF,ped));
return;
/** Initialize */
virtual Bool_t Init();
-
+ /** Run this task */
+ virtual void Exec(Option_t* option="");
+
/** The response shape of the VA1 shaping circuit is approximently
given by
@f[
/** @return Get the shaping time */
Float_t GetShapingTime() const { return fShapingTime; }
protected:
+ /** Set-up loaders, etc.
+ @param fmd On return, contains pointer to loaded AliFMD object.
+ @param outFMD On return, contains pointer to loaded loader.
+ @return kTRUE on success, kFALSE otherwise */
+ virtual Bool_t SetupLoaders(AliFMD*& fmd, AliLoader*& outFMD);
+ /** Set-up loaders, etc.
+ @param fmd Pointer to loaded AliFMD object
+ @return kFALSE on failures. */
+ virtual Bool_t LoopOverInput(AliFMD* fmd);
+ /** Output to disk
+ @param outFMD Loader
+ @param fmd AliFMD object */
+ virtual void OutputTree(AliLoader* outFMD, AliFMD* fmd) = 0;
/** Sum energy deposited contributions from each hit in a cache
@param fmd Pointer to detector */
virtual void SumContributions(AliFMD* fmd);
// Get transformation matrix for this node, and store it.
TGeoMatrix* t = new TGeoHMatrix(*pm);
trans->AddAt(t, base+imod);
- AliFMDDebug(1, ("Found matrix for path \"%s\": %p",path.Data(),pm));
+ AliFMDDebug(5, ("Found matrix for path \"%s\": %p",path.Data(),pm));
}
}
}
//////////////////////////////////////////////////////////////////////////////
//
// This class contains the procedures simulation ADC signal for the
-// Forward Multiplicity detector : Hits->Digits and Hits->SDigits
+// Forward Multiplicity detector : Hits->Digits
//
// Digits consists of
// - Detector #
// - Strip #
// - ADC count in this channel
//
-// Digits consists of
-// - Detector #
-// - Ring ID
-// - Sector #
-// - Strip #
-// - Total energy deposited in the strip
-// - ADC count in this channel
-//
// As the Digits and SDigits have so much in common, the classes
// AliFMDDigitizer and AliFMDSDigitizer are implemented via a base
// class AliFMDBaseDigitizer.
// we'd like have the option, and so it should be reflected in
// the code.
//
+// These parameters are fetched from OCDB via the mananger AliFMDParameters.
//
// The shaping function of the VA1_ALICE is generally given by
//
#include <TTree.h> // ROOT_TTree
#include <TRandom.h> // ROOT_TRandom
-// #include <AliLog.h> // ALILOG_H
-#include "AliFMDDebug.h" // Better debug macros
+#include "AliFMDDebug.h" // Better debug macros
#include "AliFMDDigitizer.h" // ALIFMDDIGITIZER_H
#include "AliFMD.h" // ALIFMD_H
-// #include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
-// #include "AliFMDDetector.h" // ALIFMDDETECTOR_H
-// #include "AliFMDRing.h" // ALIFMDRING_H
-// #include "AliFMDHit.h" // ALIFMDHIT_H
#include "AliFMDDigit.h" // ALIFMDDIGIT_H
#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
#include <AliRunDigitizer.h> // ALIRUNDIGITIZER_H
ClassImp(AliFMDDigitizer)
//____________________________________________________________________
-AliFMDDigitizer::AliFMDDigitizer()
- : AliFMDBaseDigitizer()
-{
- // Default ctor - don't use it
-}
-
-//____________________________________________________________________
-AliFMDDigitizer::AliFMDDigitizer(AliRunDigitizer* manager)
- : AliFMDBaseDigitizer(manager)
-{
- // Normal CTOR
- AliFMDDebug(1, (" processed"));
-}
-
-//____________________________________________________________________
-void
-AliFMDDigitizer::Exec(Option_t*)
+void
+AliFMDDigitizer::OutputTree(AliLoader* outFMD, AliFMD* fmd)
{
- // Get the output manager
- TString outFolder(fManager->GetOutputFolderName());
- AliRunLoader* out =
- AliRunLoader::GetRunLoader(outFolder.Data());
- // Get the FMD output manager
- AliLoader* outFMD = out->GetLoader("FMDLoader");
-
- // Get the input loader
- TString inFolder(fManager->GetInputFolderName(0));
- fRunLoader =
- AliRunLoader::GetRunLoader(inFolder.Data());
- if (!fRunLoader) {
- AliError("Can not find Run Loader for input stream 0");
- return;
- }
- // Get the AliRun object
- if (!fRunLoader->GetAliRun()) fRunLoader->LoadgAlice();
-
- // Get the AliFMD object
- AliFMD* fmd =
- static_cast<AliFMD*>(fRunLoader->GetAliRun()->GetDetector("FMD"));
- if (!fmd) {
- AliError("Can not get FMD from gAlice");
- return;
- }
-
- Int_t nFiles= fManager->GetNinputs();
- for (Int_t inputFile = 0; inputFile < nFiles; inputFile++) {
- AliFMDDebug(1, (" Digitizing event number %d",
- fManager->GetOutputEventNr()));
- // Get the current loader
- fRunLoader =
- AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile));
- if (!fRunLoader) Fatal("Exec", "no run loader");
- // Cache contriutions
- SumContributions(fmd);
- }
- // Digitize the event
- DigitizeHits(fmd);
-
// Load digits from the tree
outFMD->LoadDigits("update");
+
// Get the tree of digits
TTree* digitTree = outFMD->TreeD();
if (!digitTree) {
digitTree = outFMD->TreeD();
}
digitTree->Reset();
+
+ // Get the digits
+ TClonesArray* digits = fmd->Digits();
+ if (!digits) {
+ AliError("Failed to get digits");
+ return;
+ }
+ AliFMDDebug(1, ("Got a total of %5d digits", digits->GetEntries()));
+
// Make a branch in the tree
- TClonesArray* digits = fmd->Digits();
fmd->MakeBranchInTree(digitTree, fmd->GetName(), &(digits), 4000, 0);
// TBranch* digitBranch = digitTree->GetBranch(fmd->GetName());
// Fill the tree
fmd->ResetDigits();
}
-
//____________________________________________________________________
UShort_t
AliFMDDigitizer::MakePedestal(UShort_t detector,
{
public:
/** CTOR */
- AliFMDDigitizer();
+ AliFMDDigitizer() : AliFMDBaseDigitizer() {}
/** CTOR
@param manager Manager of digitization */
- AliFMDDigitizer(AliRunDigitizer * manager);
+ AliFMDDigitizer(AliRunDigitizer * manager)
+ : AliFMDBaseDigitizer(manager) {}
/** DTOR */
virtual ~AliFMDDigitizer() {}
- /** Do everything
- @param option Not used */
- virtual void Exec(Option_t* option=0);
protected:
+ /** Output to disk
+ @param outFMD Loader
+ @param fmd AliFMD object */
+ virtual void OutputTree(AliLoader* outFMD, AliFMD* fmd);
/** Add a digit to output.
@param fmd Pointer to detector object
@param detector Detector #
#include "AliFMDDisplay.h" // ALIFMDDISPLAY_H
#include "AliFMDHit.h" // ALIFMDHIT_H
#include "AliFMDDigit.h" // ALIFMDDIGIT_H
+#include "AliFMDSDigit.h" // ALIFMDSDIGIT_H
#include "AliFMDRecPoint.h" // ALIFMDRECPOINT_H
#include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
// Constructor of an FMD display object.
// Must be called
// before Instance
+ SetName("AliFMDDisplay");
+ SetTitle("3D Display of various kinds of FMD data");
AddLoad(kGeometry);
if (fgInstance) delete fgInstance;
fgInstance = this;
// gStyle->SetCanvasPreferGL(kTRUE);
Double_t y1 = .10;
Int_t w = 700;
- fCanvas = new TCanvas("gldisplay", "Display", w, Int_t(w / (1-y1)));
+ fCanvas = new TCanvas(Form("gl%s", GetName()),
+ Form("%s - Display", GetTitle()),
+ w, Int_t(w / (1-y1)));
fCanvas->SetFillColor(1);
fCanvas->ToggleEventStatus();
fCanvas->cd();
"lower limit");
}
}
- if (TESTBIT(fTreeMask, kHits) ||
- TESTBIT(fTreeMask, kESD) ||
- TESTBIT(fTreeMask, kDigits) ||
+ if (TESTBIT(fTreeMask, kHits) ||
+ TESTBIT(fTreeMask, kESD) ||
+ TESTBIT(fTreeMask, kDigits) ||
+ TESTBIT(fTreeMask, kSDigits) ||
TESTBIT(fTreeMask, kRaw)) {
yb = .05;
fSlider = new TSlider("genCut", "Multiplicity cut", 0, 0, xb, yb);
// The factor depends on what is
// drawn in the AUX canvas
AliInfo(Form("Noise factor is now %4.1f, pedestal factor %3.1f",
- fFactor->GetMinimum()*10,fFactor->GetMaximum()));
+ 10*fFactor->GetMinimum(),fFactor->GetMaximum()));
Redisplay();
}
return kTRUE;
}
+//____________________________________________________________________
+Bool_t
+AliFMDDisplay::ProcessSDigit(AliFMDSDigit* sdigit)
+{
+ // Process a sdigit
+ // Parameters:
+ // sdigit Digit information
+
+ static const Float_t rMin = 0;
+ static const Float_t rMax = 1023;
+ if (!sdigit) { AliError("No sdigit"); return kFALSE; }
+
+ UShort_t det = sdigit->Detector();
+ Char_t ring = sdigit->Ring();
+ UShort_t sec = sdigit->Sector();
+ UShort_t str = sdigit->Strip();
+ Float_t counts = sdigit->Counts();
+
+ if (fHits) fHits->Add(sdigit);
+ if (fSpec) fSpec->Fill(counts);
+ if (!InsideCut(counts, rMin, rMax)) return kTRUE;
+ if (fSpecCut) fSpecCut->Fill(counts);
+
+
+ AddMarker(det, ring, sec, str, sdigit, counts, rMin, rMax);
+ return kTRUE;
+}
+
//____________________________________________________________________
Bool_t
AliFMDDisplay::ProcessRaw(AliFMDDigit* digit)
@param digit Digit to draw
@return @c false on error */
virtual Bool_t ProcessDigit(AliFMDDigit* digit);
+ /** Visualize a summable digit
+ @param sdigit Summable digit to draw
+ @return @c false on error */
+ virtual Bool_t ProcessSDigit(AliFMDSDigit* sdigit);
/** Visualize a raw digit
@param digit Raw digit.
@return @c false on error */
//____________________________________________________________________
AliFMDInput::AliFMDInput()
- : fGAliceFile(""),
+ : TNamed("AliFMDInput", "Input handler for various FMD data"),
+ fGAliceFile(""),
fLoader(0),
fRun(0),
fStack(0),
//____________________________________________________________________
AliFMDInput::AliFMDInput(const char* gAliceFile)
- : fGAliceFile(gAliceFile),
+ : TNamed("AliFMDInput", "Input handler for various FMD data"),
+ fGAliceFile(gAliceFile),
fLoader(0),
fRun(0),
fStack(0),
// Possibly load global kinematics information
if (TESTBIT(fTreeMask, kKinematics) || TESTBIT(fTreeMask, kTracks)) {
// AliInfo("Getting kinematics");
- if (fLoader->LoadKinematics()) return kFALSE;
+ if (fLoader->LoadKinematics("READ")) return kFALSE;
fStack = fLoader->Stack();
}
// Possibly load FMD Hit information
if (TESTBIT(fTreeMask, kHits) || TESTBIT(fTreeMask, kTracks)) {
// AliInfo("Getting FMD hits");
- if (!fFMDLoader || fFMDLoader->LoadHits()) return kFALSE;
+ if (!fFMDLoader || fFMDLoader->LoadHits("READ")) return kFALSE;
fTreeH = fFMDLoader->TreeH();
if (!fArrayH) fArrayH = fFMD->Hits();
}
// Possibly load FMD Digit information
if (TESTBIT(fTreeMask, kDigits)) {
// AliInfo("Getting FMD digits");
- if (!fFMDLoader || fFMDLoader->LoadDigits()) return kFALSE;
+ if (!fFMDLoader || fFMDLoader->LoadDigits("READ")) return kFALSE;
fTreeD = fFMDLoader->TreeD();
if (fTreeD) {
if (!fArrayD) fArrayD = fFMD->Digits();
// Possibly load FMD Sdigit information
if (TESTBIT(fTreeMask, kSDigits)) {
// AliInfo("Getting FMD summable digits");
- if (!fFMDLoader || fFMDLoader->LoadSDigits()) return kFALSE;
+ if (!fFMDLoader || fFMDLoader->LoadSDigits("READ")) return kFALSE;
fTreeS = fFMDLoader->TreeS();
if (!fArrayS) fArrayS = fFMD->SDigits();
}
// Possibly load FMD RecPoints information
if (TESTBIT(fTreeMask, kRecPoints)) {
// AliInfo("Getting FMD reconstructed points");
- if (!fFMDLoader || fFMDLoader->LoadRecPoints()) return kFALSE;
+ if (!fFMDLoader || fFMDLoader->LoadRecPoints("READ")) return kFALSE;
fTreeR = fFMDLoader->TreeR();
if (!fArrayR) fArrayR = new TClonesArray("AliFMDRecPoint");
fTreeR->SetBranchAddress("FMD", &fArrayR);
{
// Read the digit tree, and pass each digit to the member function
// ProcessDigit.
+ if (!fTreeD) {
+ AliError("No digit tree defined");
+ return kFALSE;
+ }
+ if (!fArrayD) {
+ AliError("No digit array defined");
+ return kFALSE;
+ }
+
Int_t nEv = fTreeD->GetEntries();
for (Int_t i = 0; i < nEv; i++) {
Int_t digitRead = fTreeD->GetEntry(i);
if (digitRead <= 0) continue;
Int_t nDigit = fArrayD->GetEntries();
+ AliFMDDebug(0, ("Got %5d digits for this event", nDigit));
if (nDigit <= 0) continue;
for (Int_t j = 0; j < nDigit; j++) {
AliFMDDigit* digit = static_cast<AliFMDDigit*>(fArrayD->At(j));
{
// Read the summable digit tree, and pass each sumable digit to the
// member function ProcessSdigit.
- Int_t nEv = fTreeD->GetEntries();
+ if (!fTreeS) {
+ AliWarning("No sdigit tree defined");
+ return kTRUE; // Empty SDigits is fine
+ }
+ if (!fArrayS) {
+ AliWarning("No sdigit array defined");
+ return kTRUE; // Empty SDigits is fine
+ }
+
+ Int_t nEv = fTreeS->GetEntries();
for (Int_t i = 0; i < nEv; i++) {
Int_t sdigitRead = fTreeS->GetEntry(i);
if (sdigitRead <= 0) continue;
Int_t nSdigit = fArrayS->GetEntries();
+ AliFMDDebug(0, ("Got %5d digits for this event", nSdigit));
if (nSdigit <= 0) continue;
for (Int_t j = 0; j < nSdigit; j++) {
AliFMDSDigit* sdigit = static_cast<AliFMDSDigit*>(fArrayS->At(j));
{
// Read the digit tree, and pass each digit to the member function
// ProcessDigit.
+ if (!fArrayA) {
+ AliError("No raw digit array defined");
+ return kFALSE;
+ }
+
Int_t nDigit = fArrayA->GetEntries();
if (nDigit <= 0) return kTRUE;
for (Int_t j = 0; j < nDigit; j++) {
{
// Read the reconstrcted points tree, and pass each reconstruction
// object (AliFMDRecPoint) to either ProcessRecPoint.
+ if (!fTreeR) {
+ AliError("No recpoint tree defined");
+ return kFALSE;
+ }
+ if (!fArrayR) {
+ AliError("No recpoints array defined");
+ return kFALSE;
+ }
+
Int_t nEv = fTreeR->GetEntries();
for (Int_t i = 0; i < nEv; i++) {
Int_t recRead = fTreeR->GetEntry(i);
classes for customized class that do some sort of analysis on the
various types of data produced by the FMD.
*/
-#include <TObject.h>
+#include <TNamed.h>
#ifndef ROOT_TString
# include <TString.h>
#endif
various scripts in @c FMD/scripts.
@ingroup FMD_util
*/
-class AliFMDInput : public TObject
+class AliFMDInput : public TNamed
{
public:
/** The kinds of data that can be read in. */
/** Copy ctor
@param o Object to copy from */
AliFMDInput(const AliFMDInput& o)
- : TObject(o),
+ : TNamed(o),
fGAliceFile(""),
fLoader(0),
fRun(0),
AliCDBEntry* gain = GetEntry(fgkPulseGain, pp);
if (!gain) return;
- AliFMDDebug(1, ("Got gain from CDB"));
+ AliFMDDebug(5, ("Got gain from CDB"));
fPulseGain = dynamic_cast<AliFMDCalibGain*>(gain->GetObject());
if (!fPulseGain) AliFatal("Invalid pulser gain object from CDB");
}
AliCDBEntry* pedestal = GetEntry(fgkPedestal, pp);
if (!pedestal) return;
- AliFMDDebug(1, ("Got pedestal from CDB"));
+ AliFMDDebug(5, ("Got pedestal from CDB"));
fPedestal = dynamic_cast<AliFMDCalibPedestal*>(pedestal->GetObject());
if (!fPedestal) AliFatal("Invalid pedestal object from CDB");
}
AliCDBEntry* deadMap = GetEntry(fgkDead, pp);
if (!deadMap) return;
- AliFMDDebug(1, ("Got dead map from CDB"));
+ AliFMDDebug(5, ("Got dead map from CDB"));
fDeadMap = dynamic_cast<AliFMDCalibDeadMap*>(deadMap->GetObject());
if (!fDeadMap) AliFatal("Invalid dead map object from CDB");
}
// Get 0-suppression from CDB
AliCDBEntry* zeroSup = GetEntry(fgkZeroSuppression, pp);
if (!zeroSup) return;
- AliFMDDebug(1, ("Got zero suppression from CDB"));
+ AliFMDDebug(5, ("Got zero suppression from CDB"));
fZeroSuppression =
dynamic_cast<AliFMDCalibZeroSuppression*>(zeroSup->GetObject());
if (!fZeroSuppression)AliFatal("Invalid zero suppression object from CDB");
// get Sample rate from CDB
AliCDBEntry* sampRat = GetEntry(fgkSampleRate, pp);
if (!sampRat) return;
- AliFMDDebug(1, ("Got zero suppression from CDB"));
+ AliFMDDebug(5, ("Got zero suppression from CDB"));
fSampleRate = dynamic_cast<AliFMDCalibSampleRate*>(sampRat->GetObject());
if (!fSampleRate) AliFatal("Invalid zero suppression object from CDB");
}
AliCDBEntry* hwMap = GetEntry(fgkAltroMap, pp, kFALSE);
if (!hwMap) return;
- AliFMDDebug(1, ("Got ALTRO map from CDB"));
+ AliFMDDebug(5, ("Got ALTRO map from CDB"));
fAltroMap = dynamic_cast<AliFMDAltroMapping*>(hwMap->GetObject());
if (!fAltroMap) {
AliFatal("Invalid ALTRO map object from CDB");
// Get strips read-out from CDB
AliCDBEntry* range = GetEntry(fgkStripRange, pp);
if (!range) return;
- AliFMDDebug(1, ("Got strip range from CDB"));
+ AliFMDDebug(5, ("Got strip range from CDB"));
fStripRange = dynamic_cast<AliFMDCalibStripRange*>(range->GetObject());
if (!fStripRange) AliFatal("Invalid strip range object from CDB");
}
// gAliceFile The galice.root file to use - if any.
//
+ SetName("AliFMDPattern");
+ SetName("2D display of FMD data");
+
// RemoveLoad(kGeometry);
fEvent.SetBit(TLatex::kTextNDC);
fFMD1Sum.SetBit(TLatex::kTextNDC);
//////////////////////////////////////////////////////////////////////////////
//
// This class contains the procedures simulation ADC signal for the
-// Forward Multiplicity detector : Hits->Digits and Hits->SDigits
+// Forward Multiplicity detector : Hits->SDigits
//
-// Digits consists of
-// - Detector #
-// - Ring ID
-// - Sector #
-// - Strip #
-// - ADC count in this channel
-//
-// Digits consists of
+// SDigits consists of
// - Detector #
// - Ring ID
// - Sector #
// we'd like have the option, and so it should be reflected in
// the code.
//
+// These parameters are fetched from OCDB via the mananger AliFMDParameters.
//
// The shaping function of the VA1_ALICE is generally given by
//
// -1 + B + exp(-B)
//
-// #include <TTree.h> // ROOT_TTree
-//#include <TRandom.h> // ROOT_TRandom
-// #include <AliLog.h> // ALILOG_H
#include "AliFMDDebug.h" // Better debug macros
#include "AliFMDSDigitizer.h" // ALIFMDDIGITIZER_H
#include "AliFMD.h" // ALIFMD_H
-// #include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
-// #include "AliFMDDetector.h" // ALIFMDDETECTOR_H
-// #include "AliFMDRing.h" // ALIFMDRING_H
#include "AliFMDHit.h" // ALIFMDHIT_H
-// #include "AliFMDDigit.h" // ALIFMDDIGIT_H
-// #include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
-// #include <AliRunDigitizer.h> // ALIRUNDIGITIZER_H
#include <AliRun.h> // ALIRUN_H
#include <AliLoader.h> // ALILOADER_H
#include <AliRunLoader.h> // ALIRUNLOADER_H
//====================================================================
ClassImp(AliFMDSDigitizer)
-//____________________________________________________________________
-AliFMDSDigitizer::AliFMDSDigitizer()
-{
- // Default ctor - don't use it
-}
-
+#if 0
//____________________________________________________________________
AliFMDSDigitizer::AliFMDSDigitizer(const Char_t* headerFile,
- const Char_t* /* sdigfile */)
+ const Char_t* /* sdigfile */)
: AliFMDBaseDigitizer("FMDSDigitizer", "FMD SDigitizer")
{
// Normal CTOR
- AliFMDDebug(1, (" processed"));
+ AliFMDDebug(1, ("Constructed"));
fRunLoader = AliRunLoader::GetRunLoader(); // Open(headerFile);
if (!fRunLoader)
Fatal("AliFMDSDigitizer", "cannot open session, header file '%s'",
- headerFile);
+ headerFile);
AliLoader* loader = fRunLoader->GetLoader("FMDLoader");
if (!loader)
Fatal("AliFMDSDigitizer", "cannot find FMD loader in specified event");
// Add task to tasks folder
loader->PostSDigitizer(this);
-
}
-
//____________________________________________________________________
AliFMDSDigitizer::~AliFMDSDigitizer()
{
// Destructor
AliLoader* loader = fRunLoader->GetLoader("FMDLoader");
loader->CleanSDigitizer();
+ AliFMDDebug(1, ("Destructed"));
}
-
//____________________________________________________________________
void
AliFMDSDigitizer::Exec(Option_t*)
}
}
+#endif
+
+//____________________________________________________________________
+void
+AliFMDSDigitizer::OutputTree(AliLoader* outFMD, AliFMD* fmd)
+{
+ // Load sdigits from the tree
+ outFMD->LoadSDigits("update");
+
+ // Get the tree of sdigits
+ TTree* sdigitTree = outFMD->TreeS();
+ if (!sdigitTree) {
+ outFMD->MakeTree("S");
+ sdigitTree = outFMD->TreeS();
+ }
+ sdigitTree->Reset();
+
+ // Get the sdigits
+ TClonesArray* sdigits = fmd->SDigits();
+ if (!sdigits) {
+ AliError("Failed to get sdigits");
+ return;
+ }
+ AliFMDDebug(5, ("Got a total of %5d sdigits", sdigits->GetEntries()));
+
+ // Make a branch in the tree
+ fmd->MakeBranchInTree(sdigitTree, fmd->GetName(), &(sdigits), 4000, 0);
+ // TBranch* sdigitBranch = sdigitTree->GetBranch(fmd->GetName());
+ // Fill the tree
+ Int_t write = 0;
+ write = sdigitTree->Fill();
+ AliFMDDebug(1, ("Wrote %d bytes to sdigit tree", write));
+
+ // Write the sdigits to disk
+ outFMD->WriteSDigits("OVERWRITE");
+ outFMD->UnloadHits();
+ outFMD->UnloadSDigits();
+
+ // Reset the sdigits in the AliFMD object
+ fmd->ResetSDigits();
+}
+
//____________________________________________________________________
void
AliFMDSDigitizer::AddDigit(AliFMD* fmd,
{
// Add a summable digit
if (count1 == 0 &&
- count1 == count2 &&
- count2 == count3 &&
- count3 == count4)
+ count2 <= 0 &&
+ count3 <= 0 &&
+ count4 <= 0)
return;
fmd->AddSDigitByFields(detector, ring, sector, strip, edep,
count1, count2, count3, count4);
{
public:
/** CTOR */
- AliFMDSDigitizer();
- /** CTOR
- @param headerFile Where to write headings
- @param sdigFile Where to write digits. */
- AliFMDSDigitizer(const Char_t* headerFile, const Char_t* sdigFile="");
+ AliFMDSDigitizer() : AliFMDBaseDigitizer() {}
+ /** CTOR
+ @param manager Manager of digitization */
+ AliFMDSDigitizer(AliRunDigitizer * manager)
+ : AliFMDBaseDigitizer(manager)
+ {}
/** DTOR */
- virtual ~AliFMDSDigitizer();
- /** Do it all
- @param option Not used */
- virtual void Exec(Option_t* option=0);
+ virtual ~AliFMDSDigitizer() {}
protected:
+ /** Output to disk
+ @param outFMD Loader
+ @param fmd AliFMD object */
+ virtual void OutputTree(AliLoader* outFMD, AliFMD* fmd);
/** Add a digit to output.
@param fmd Pointer to detector object
@param detector Detector #
#pragma link C++ class AliFMDBaseDigitizer+;
#pragma link C++ class AliFMDDigitizer+;
#pragma link C++ class AliFMDSDigitizer+;
+#pragma link C++ class AliFMDSSDigitizer+;
#pragma link C++ class AliFMDRawWriter+;
#pragma link C++ class AliFMDQADataMakerSim+;
#else
# error Not for compilation
+
#endif
//
// EOF
AliFMDBaseDigitizer.cxx \
AliFMDDigitizer.cxx \
AliFMDSDigitizer.cxx \
+ AliFMDSSDigitizer.cxx \
AliFMDEdepMap.cxx \
AliFMDRawWriter.cxx \
AliFMDQADataMakerSim.cxx
gSystem->Load("libFMDutil.so");
AliFMDPattern* d = new AliFMDPattern;
d->AddLoad(AliFMDInput::kDigits);
+ d->SetName("digit");
+ d->SetTitle("Digits");
// d->AddLoad(AliFMDInput::kKinematics);
d->Run();
}
gSystem->Load("libFMDutil.so");
AliFMDPattern* d = new AliFMDPattern;
d->AddLoad(AliFMDInput::kHits);
+ d->SetName("hit");
+ d->SetTitle("Hits");
// d->AddLoad(AliFMDInput::kKinematics);
d->Run();
}