// These files are not in the same directory, so there's no reason to
// ask the preprocessor to search in the current directory for these
// files by including them with `#include "..."'
-#include <math.h> // __CMATH__
+// #include <math.h> // __CMATH__
#include <TClonesArray.h> // ROOT_TClonesArray
#include <TGeometry.h> // ROOT_TGeomtry
#include <TNode.h> // ROOT_TNode
#include <TTUBE.h> // ROOT_TTUBE
#include <TTree.h> // ROOT_TTree
#include <TBrowser.h> // ROOT_TBrowser
-#include <TMath.h> // ROOT_TMath
-#include <TVirtualMC.h> // ROOT_TVirtualMC
-#include <TVector2.h>
-#include <TVector3.h>
-#include <TMarker3DBox.h>
+// #include <TVirtualMC.h> // ROOT_TVirtualMC
+#include <TVector2.h> // ROOT_TVector2
#include <AliRunDigitizer.h> // ALIRUNDIGITIZER_H
#include <AliLoader.h> // ALILOADER_H
#include <AliRun.h> // ALIRUN_H
#include <AliMC.h> // ALIMC_H
-#include "AliMagF.h" // ALIMAGF_H
+#include <AliMagF.h> // ALIMAGF_H
#include <AliLog.h> // ALILOG_H
#include "AliFMD.h" // ALIFMD_H
-#include "AliFMDDigit.h" // ALIFMDDIGIG_H
+#include "AliFMDDigit.h" // ALIFMDDIGIT_H
+#include "AliFMDSDigit.h" // ALIFMDSDIGIT_H
#include "AliFMDHit.h" // ALIFMDHIT_H
#include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
#include "AliFMDDetector.h" // ALIFMDDETECTOR_H
#include "AliFMDRing.h" // ALIFMDRING_H
#include "AliFMDDigitizer.h" // ALIFMDDIGITIZER_H
-#include "AliPoints.h" // ALIPOINTS_H
-#include "AliFMDGeometryBuilder.h"
+#include "AliFMDSDigitizer.h" // ALIFMDSDIGITIZER_H
+// #include "AliFMDGeometryBuilder.h"
#include "AliFMDRawWriter.h" // ALIFMDRAWWRITER_H
-
-
-class AliFMDPoints : public AliPoints
-{
-public:
- /** Constructor
- @param hit Hit to draw
- @param color Color of hit */
- AliFMDPoints(AliFMDHit* hit, UInt_t color)
- : AliPoints(1), fMarker(0)
- {
- if (!hit) return;
- Float_t size = TMath::Min(TMath::Max(hit->Edep() * .1, .1), 1.);
- TVector3 p(hit->Px(), hit->Py(), hit->Pz());
- fMarker = new TMarker3DBox(hit->X(), hit->Y(), hit->Z(), size, size, size,
- p.Theta(), p.Phi());
- fMarker->SetLineColor(color);
- fMarker->SetRefObject(this);
- fP[0] = hit->X();
- fP[1] = hit->Y();
- fP[2] = hit->Z();
- }
- /** Destructor */
- ~AliFMDPoints()
- {
- // if (fMarker) delete fMarker;
- }
- void SetXYZ(Double_t x, Double_t y, Double_t z)
- {
- if (fMarker) fMarker->SetPosition(x, y, z);
- }
- Int_t DistancetoPrimitive(Int_t px, Int_t py)
- {
- return fMarker->DistancetoPrimitive(px, py);
- }
- void Draw(Option_t* option)
- {
- if (fMarker) fMarker->Draw(option);
- }
- void Paint(Option_t* option)
- {
- if (fMarker) fMarker->Paint(option);
- }
- void SetMarkerColor(Color_t colour)
- {
- if (fMarker) fMarker->SetLineColor(colour);
- }
-private:
- TMarker3DBox* fMarker;
-};
-
+#include "AliFMDPoints.h" // ALIFMDPOINTS_H
//____________________________________________________________________
ClassImp(AliFMD)
return;
}
Double_t siThick = r->GetSiThickness();
- const Int_t nv = r->GetNVerticies();
+ const Int_t knv = r->GetNVerticies();
Double_t theta = r->GetTheta();
Int_t nmod = r->GetNModules();
- TXTRU* shape = new TXTRU(r->GetName(), r->GetTitle(), "void", nv, 2);
- for (Int_t j = 0; j < nv; j++) {
- TVector2* vv = r->GetVertex(nv - 1 - j);
+ TXTRU* shape = new TXTRU(r->GetName(), r->GetTitle(), "void", knv, 2);
+ for (Int_t j = 0; j < knv; j++) {
+ TVector2* vv = r->GetVertex(knv - 1 - j);
shape->DefineVertex(j, vv->X(), vv->Y());
}
shape->DefineSection(0, -siThick / 2, 1, 0, 0);
//____________________________________________________________________
Int_t
-AliFMD::DistanceToPrimitive(Int_t, Int_t)
+AliFMD::DistancetoPrimitive(Int_t, Int_t)
{
// Calculate the distance from the mouse to the FMD on the screen
// Dummy routine.
#ifndef ALIDETECTOR_H
# include <AliDetector.h>
#endif
-#ifndef ROOT_TBranch
-# include <TBranch.h>
-#endif
class TBranch;
class TClonesArray;
class TBrowser;
virtual void DrawDetector();
/** Calculate the distance from the mouse to the FMD on the screen
Dummy routine */
- virtual Int_t DistanceToPrimitive(Int_t px, Int_t py);
+ virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
/** Store x, y, z of all hits in memory for display.
Normally, the hits are drawn using TPolyMarker3D - however, that
is not very useful for the FMD. Therefor, this member function
// It is the FMD ring with highest eta
//
#include "AliFMD1.h" // ALIFMD1_H
-#include "AliFMDRing.h" // ALIFMDRING_H
+// #include "AliFMDRing.h" // ALIFMDRING_H
//====================================================================
@date Sun Mar 26 18:00:56 2006
@brief Declaration of FMD1 declaration
*/
-
+// Geometry description and parameters of the FMD1 detector. The FMD1
+// has only one ring. Need to flesh out the support once it's
+// defined
+//
#ifndef ALIFMDDETECTOR_H
# include "AliFMDDetector.h"
#endif
/** @class AliFMD1 AliFMD1.h <FMD/AliFMD1.h>
@brief Geometry description and parameters of the FMD1 detector.
The FMD1 has only one ring.
+ @todo Need to flesh out the support once it's defined
@image html FMD1.png
@ingroup FMD_base
*/
// Support is not fleshed ot yet.
//
#include "AliFMD2.h" // ALIFMD2_H
-#include "AliFMDRing.h" // ALIFMDRING_H
+// #include "AliFMDRing.h" // ALIFMDRING_H
//====================================================================
ClassImp(AliFMD2)
@date Sun Mar 26 18:25:28 2006
@brief Geometry parameters of the FMD2 detector.
*/
+// Geometry parameters of the FMD2 detector. This has two rings.
+// Other than that it's fairly straight forward. Needs to make the
+// full support stuff.
+//
#ifndef ALIFMDDETECTOR_H
# include "AliFMDDetector.h"
#endif
/** @class AliFMD2 AliFMD2.h <FMD/AliFMD2.h>
@brief Geometry parameters of the FMD2 detector.
This has two rings.
+ @todo Flesh out support once it's defined
@image html FMD2.png
@ingroup FMD_base
*/
class AliFMD2 : public AliFMDDetector
{
-protected:
public:
/** Constructor
@param inner Pointer to inner ring description
@param outer Pointer to outer ring description */
AliFMD2(AliFMDRing* inner, AliFMDRing* outer);
+ /** Destructor */
+ virtual ~AliFMD2() {}
/** Initialize the geometry */
virtual void Init();
ClassDef(AliFMD2, 1);
#include "AliFMD3.h" // ALIFMD3_H
#include "AliLog.h" // ALILOG_H
#include "AliFMDRing.h" // ALIFMDRING_H
-#include <TMath.h> // ROOT_TMath
+// #include <TMath.h> // ROOT_TMath
//====================================================================
ClassImp(AliFMD3)
@date Sun Mar 26 18:23:48 2006
@brief Geometry parameters of the FMD3 detector.
*/
+// Geometry parameters of the FMD3 detector. FMD3 has a fairly
+// complicated support structure. The cone also supports the
+// beam-pipe.
+//
#ifndef ALIFMDDETECTOR_H
# include "AliFMDDetector.h"
#endif
@brief Implementation of AliFMDAlignFaker
*/
//____________________________________________________________________
+//
+// Class
+// to
+// make
+// fake
+// alignment
+// parameters
+//
+//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers.
//
#include "AliFMDAlignFaker.h" // ALIFMDALIGNFAKER_H
#include <AliCDBManager.h> // ALICDBMANAGER_H
#include <AliCDBEntry.h> // ALICDBMANAGER_H
-#include <AliAlignObj.h>
+// #include <AliAlignObj.h>
#include <AliAlignObjAngles.h>
-#include <Riostream.h>
-#include <TSystem.h>
-#include <TMath.h>
+// #include <Riostream.h>
+// #include <TSystem.h>
+// #include <TMath.h>
#include <TRandom.h>
#include <TClonesArray.h>
#include <TString.h>
#include <TFile.h>
#include <TGeoManager.h>
#include <TGeoNode.h>
-#include <TGeoVolume.h>
-#include <TROOT.h>
+// #include <TGeoVolume.h>
+// #include <TROOT.h>
//====================================================================
ClassImp(AliFMDAlignFaker)
Double_t transX, Double_t transY, Double_t transZ,
Double_t rotX, Double_t rotY, Double_t rotZ)
{
+ // make alignment for a path
+ // Params:
+ // path Path to node
+ // id Volume number
+ // transX Translation in X
+ // transZ Translation in Y
+ // transZ Translation in Z
+ // rotX Rotation about X-axis
+ // rotY Rotation about Y-axis
+ // rotZ Rotation about Z-axis
AliDebug(1, Form("Make alignment for %s (volume %d): (%f,%f,%f) (%f,%f,%f)",
path.Data(), id, transX, transY, transZ, rotX, rotY, rotZ));
Int_t nAlign = fArray->GetEntries();
Bool_t
AliFMDAlignFaker::MakeAlignHalf(const TString& path, Int_t id)
{
+ // Make alignment of a half ring/cone
AliDebug(15, Form("Make alignment for half-ring/cone %s", path.Data()));
Double_t transX = gRandom->Uniform(fHalfTransMin.X(), fHalfTransMax.X());
Double_t transY = gRandom->Uniform(fHalfTransMin.Y(), fHalfTransMax.Y());
Bool_t
AliFMDAlignFaker::MakeAlignSensor(const TString& path, Int_t id)
{
+ // Make alignment of a sensor
AliDebug(15, Form("Make alignment for sensor %s", path.Data()));
Double_t transX = gRandom->Uniform(fSensorTransMin.X(), fSensorTransMax.X());
Double_t transY = gRandom->Uniform(fSensorTransMin.Y(), fSensorTransMax.Y());
void
AliFMDAlignFaker::WriteToFile()
{
+ // Write to a local file
TFile* file = TFile::Open(GetTitle(), "RECREATE");
if (!file) {
AliFatal(Form("Failed to open file '%s' for output", GetTitle()));
*/
//____________________________________________________________________
//
-// Class to make fake alignration parameters
+// Class
+// to
+// make
+// fake
+// alignment
+// parameters
//
#ifndef ROOT_TTask
# include <TTask.h>
@param option Not used. */
void Exec(Option_t* option="");
protected:
+ AliFMDAlignFaker(const AliFMDAlignFaker& o) : TTask(o) {}
+ AliFMDAlignFaker& operator=(const AliFMDAlignFaker&) { return *this; }
+
/** Make the alignment object for a path
@param path Node path.
@param volID Volume identifier
//
// Mapping of ALTRO hardware channel to detector coordinates
//
+// The hardware address consist of a DDL number and 12bits of ALTRO
+// addresses. The ALTRO address are formatted as follows.
+//
+// 12 7 4 0
+// |---------------|---------|------------|
+// | Board # | ALTRO # | Channel # |
+// +---------------+---------+------------+
+//
+//
+//
#include "AliFMDAltroMapping.h" // ALIFMDALTROMAPPING_H
#include "AliFMDParameters.h"
#include "AliLog.h"
#ifndef ROOT_TArrayI
# include <TArrayI.h>
#endif
-
+//
+// Map hardware address to detector coordinates.
+//
+// The hardware address consist of a DDL number and 12bits of ALTRO
+// addresses. The ALTRO address are formatted as follows.
+//
+// 12 7 4 0
+// |---------------|---------|------------|
+// | Board # | ALTRO # | Channel # |
+// +---------------+---------+------------+
+//
+//
//____________________________________________________________________
/** @class AliFMDAltroMapping
@brief Class that encodes a map to/from ALTRO hardware address to
public:
/** Constructor */
AliFMDAltroMapping();
+ /** Destructor */
+ virtual ~AliFMDAltroMapping() {}
/** Map a hardware address into a detector index.
@param ddl Hardware DDL number
@param hwaddr Hardware address.
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2004, 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$ */
+/** @file AliFMDBaseDigit.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:37:41 2006
+ @brief Digits for the FMD
+ @ingroup FMD_base
+*/
+//////////////////////////////////////////////////////////////////////
+//
+// Digits classes for the FMD
+//
+// Digits consists of
+// - Detector #
+// - Ring ID
+// - Sector #
+// - 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
+// AliFMDDigit and AliFMDSDigit are implemented via a base
+// class AliFMDBaseDigit.
+///
+// +-----------------+
+// | AliFMDBaseDigit |
+// +-----------------+
+// ^
+// |
+// +------------+
+// | |
+// +-------------+ +--------------+
+// | AliFMDDigit | | AliFMDSDigit |
+// +-------------+ +--------------+
+//
+// (Note, that I'd really would have liked to implement AliFMDHit as a
+// derived class from some base class - say AliFMDStrip, and the Digit
+// classes would (eventually) have derived from that as well.
+// However, ROOT doesn't do well with multiple inheritance, so I chose
+// not to anyway).
+//
+// Latest changes by Christian Holm Christensen
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "AliFMDBaseDigit.h" // ALIFMDDIGIT_H
+#include "Riostream.h" // ROOT_Riostream
+#include <TString.h>
+#include <AliLog.h>
+
+//====================================================================
+ClassImp(AliFMDBaseDigit)
+#if 0
+ ; // This is here to keep Emacs from indenting the next line
+#endif
+
+//____________________________________________________________________
+AliFMDBaseDigit::AliFMDBaseDigit()
+ : fDetector(0),
+ fRing('\0'),
+ fSector(0),
+ fStrip(0)
+{}
+
+//____________________________________________________________________
+AliFMDBaseDigit::AliFMDBaseDigit(UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip)
+ : fDetector(detector),
+ fRing(ring),
+ fSector(sector),
+ fStrip(strip)
+{
+ //
+ // Creates a base data digit object
+ //
+ // Parameters
+ //
+ // detector Detector # (1, 2, or 3)
+ // ring Ring ID ('I' or 'O')
+ // sector Sector # (For inner/outer rings: 0-19/0-39)
+ // strip Strip # (For inner/outer rings: 0-511/0-255)
+}
+
+//____________________________________________________________________
+void
+AliFMDBaseDigit::Print(Option_t* /* option*/) const
+{
+ // Print digit to standard out
+ cout << ClassName() << ": FMD" << GetName() << flush;
+}
+
+//____________________________________________________________________
+const char*
+AliFMDBaseDigit::GetName() const
+{
+ // Get the name of a FMD digit.
+ if (fName.IsNull())
+ fName = Form("FMD%d%c[%2d,%3d]", fDetector, fRing, fSector, fStrip);
+ return fName.Data();
+}
+#define fMaxStrips 512
+#define fMaxSectors 40
+#define fMaxRings 2
+
+//____________________________________________________________________
+ULong_t
+AliFMDBaseDigit::Hash() const
+{
+ size_t ringi = (fRing == 'I' || fRing == 'i' ? 0 : 1);
+ return fStrip + fMaxStrips *
+ (fSector + fMaxSectors * (ringi + fMaxRings * (fDetector - 1)));
+}
+
+
+//____________________________________________________________________
+Int_t
+AliFMDBaseDigit::Compare(const TObject* o) const
+{
+ if (!o)
+ AliFatal("Can not compare to NULL!");
+ if (o->IsA() != AliFMDBaseDigit::Class())
+ AliFatal(Form("Cannot compare to a %s object", o->ClassName()));
+ // AliFMDBaseDigit* of = static_cast<AliFMDBaseDigit*>(o);
+ if (Hash() == o->Hash()) return 0;
+ if (Hash() < o->Hash()) return -1;
+ return 1;
+}
+
+
+//____________________________________________________________________
+//
+// EOF
+//
--- /dev/null
+#ifndef ALIFMDBASEDIGIT_H
+#define ALIFMDBASEDIGIT_H
+/** @file AliFMDBaseDigit.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:37:41 2006
+ @brief Digits for the FMD
+ @ingroup FMD_base
+*/
+//___________________________________________________________________
+//
+// Digits classes for the FMD
+// AliFMDBaseDigit - base class
+// AliFMDDigit - Normal (smeared) digit
+// AliFMDSDigit - Summable (non-smeared) digit
+//
+#ifndef ROOT_TObject
+# include <TObject.h>
+#endif
+#ifndef ROOT_TString
+# include <TString.h>
+#endif
+
+//____________________________________________________________________
+/** @class AliFMDBaseDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
+ @brief base class for digits
+ @ingroup FMD_base
+ */
+class AliFMDBaseDigit : public TObject
+{
+public:
+ /** CTOR */
+ AliFMDBaseDigit();
+ /** Constrctor
+ @param detector Detector
+ @param ring Ring
+ @param sector Sector
+ @param strip Strip */
+ AliFMDBaseDigit(UShort_t detector,
+ Char_t ring='\0',
+ UShort_t sector=0,
+ UShort_t strip=0);
+ /** DTOR */
+ virtual ~AliFMDBaseDigit() {}
+ /** @return Detector # */
+ UShort_t Detector() const { return fDetector; }
+ /** @return Ring ID */
+ Char_t Ring() const { return fRing; }
+ /** @return sector # */
+ UShort_t Sector() const { return fSector; }
+ /** @return strip # */
+ UShort_t Strip() const { return fStrip; }
+ /** Print information
+ @param opt Not used */
+ virtual void Print(Option_t* opt="") const;
+ /** @return Name */
+ const char* GetName() const;
+ /** @param rhs Other digit to compare to
+ @return -1 if this is less than @a rhs, 0 if the refer to the
+ same, and 1 if @a rhs is larger than this */
+ Int_t Compare(const TObject* o) const;
+ /** @return Always true */
+ Bool_t IsSortable() const { return kTRUE; }
+protected:
+ ULong_t Hash() const;
+ UShort_t fDetector; // (Sub) Detector # (1,2, or 3)
+ Char_t fRing; // Ring ID ('I' or 'O')
+ UShort_t fSector; // Sector # (phi division)
+ UShort_t fStrip; // Strip # (radial division)
+ mutable TString fName; //! Name (cached, but not stored)
+ ClassDef(AliFMDBaseDigit, 2) // Base class for FMD digits
+};
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+// mode: C++
+// End:
+//
+//
+// EOF
+//
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2004, 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$ */
+/** @file AliFMDBaseDigitizer.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:38:26 2006
+ @brief FMD Digitizers implementation
+ @ingroup FMD_sim
+*/
+//////////////////////////////////////////////////////////////////////////////
+//
+// This class contains the procedures simulation ADC signal for the
+// Forward Multiplicity detector : Hits->Digits and Hits->SDigits
+//
+// Digits consists of
+// - Detector #
+// - Ring ID
+// - Sector #
+// - 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.
+//
+// +---------------------+
+// | AliFMDBaseDigitizer |
+// +---------------------+
+// ^
+// |
+// +----------+---------+
+// | |
+// +-----------------+ +------------------+
+// | AliFMDDigitizer | | AliFMDSDigitizer |
+// +-----------------+ +------------------+
+//
+// These classes has several paramters:
+//
+// fPedestal
+// fPedestalWidth
+// (Only AliFMDDigitizer)
+// Mean and width of the pedestal. The pedestal is simulated
+// by a Guassian, but derived classes my override MakePedestal
+// to simulate it differently (or pick it up from a database).
+//
+// fVA1MipRange
+// The dymamic MIP range of the VA1_ALICE pre-amplifier chip
+//
+// fAltroChannelSize
+// The largest number plus one that can be stored in one
+// channel in one time step in the ALTRO ADC chip.
+//
+// fSampleRate
+// How many times the ALTRO ADC chip samples the VA1_ALICE
+// pre-amplifier signal. The VA1_ALICE chip is read-out at
+// 10MHz, while it's possible to drive the ALTRO chip at
+// 25MHz. That means, that the ALTRO chip can have time to
+// sample each VA1_ALICE signal up to 2 times. Although it's
+// not certain this feature will be used in the production,
+// we'd like have the option, and so it should be reflected in
+// the code.
+//
+//
+// The shaping function of the VA1_ALICE is generally given by
+//
+// f(x) = A(1 - exp(-Bx))
+//
+// where A is the total charge collected in the pre-amp., and B is a
+// paramter that depends on the shaping time of the VA1_ALICE circut.
+//
+// When simulating the shaping function of the VA1_ALICe
+// pre-amp. chip, we have to take into account, that the shaping
+// function depends on the previous value of read from the pre-amp.
+//
+// That results in the following algorithm:
+//
+// last = 0;
+// FOR charge IN pre-amp. charge train DO
+// IF last < charge THEN
+// f(t) = (charge - last) * (1 - exp(-B * t)) + last
+// ELSE
+// f(t) = (last - charge) * exp(-B * t) + charge)
+// ENDIF
+// FOR i IN # samples DO
+// adc_i = f(i / (# samples))
+// DONE
+// last = charge
+// DONE
+//
+// Here,
+//
+// pre-amp. charge train
+// is a series of 128 charges read from the VA1_ALICE chip
+//
+// # samples
+// is the number of times the ALTRO ADC samples each of the 128
+// charges from the pre-amp.
+//
+// Where Q is the total charge collected by the VA1_ALICE
+// pre-amplifier. Q is then given by
+//
+// E S
+// Q = - -
+// e R
+//
+// where E is the total energy deposited in a silicon strip, R is the
+// dynamic range of the VA1_ALICE pre-amp (fVA1MipRange), e is the
+// energy deposited by a single MIP, and S ALTRO channel size in each
+// time step (fAltroChannelSize).
+//
+// The energy deposited per MIP is given by
+//
+// e = M * rho * w
+//
+// where M is the universal number 1.664, rho is the density of
+// silicon, and w is the depth of the silicon sensor.
+//
+// The final ADC count is given by
+//
+// C' = C + P
+//
+// where P is the (randomized) pedestal (see MakePedestal)
+//
+// This class uses the class template AliFMDMap<Type> to make an
+// internal cache of the energy deposted of the hits. The class
+// template is instantasized as
+//
+// typedef AliFMDMap<std::pair<Float_t, UShort_t> > AliFMDEdepMap;
+//
+// The first member of the values is the summed energy deposition in a
+// given strip, while the second member of the values is the number of
+// hits in a given strip. Using the second member, it's possible to
+// do some checks on just how many times a strip got hit, and what
+// kind of error we get in our reconstructed hits. Note, that this
+// information is currently not written to the digits tree. I think a
+// QA (Quality Assurance) digit tree is better suited for that task.
+// However, the information is there to be used in the future.
+//
+//
+// Latest changes by Christian Holm Christensen
+//
+//////////////////////////////////////////////////////////////////////////////
+
+// /1
+// | A(-1 + B + exp(-B))
+// | f(x) dx = ------------------- = 1
+// | B
+// / 0
+//
+// and B is the a parameter defined by the shaping time (fShapingTime).
+//
+// Solving the above equation, for A gives
+//
+// B
+// A = ----------------
+// -1 + B + exp(-B)
+//
+// So, if we define the function g: [0,1] -> [0:1] by
+//
+// / v
+// | Bu + exp(-Bu) - Bv - exp(-Bv)
+// g(u,v) = | f(x) dx = -A -----------------------------
+// | B
+// / u
+//
+// we can evaluate the ALTRO sample of the VA1_ALICE pre-amp between
+// any two times (u, v), by
+//
+//
+// B Bu + exp(-Bu) - Bv - exp(-Bv)
+// C = Q g(u,v) = - Q ---------------- -----------------------------
+// -1 + B + exp(-B) B
+//
+// Bu + exp(-Bu) - Bv - exp(-Bv)
+// = - Q -----------------------------
+// -1 + B + exp(-B)
+//
+
+#include <TTree.h> // ROOT_TTree
+//#include <TRandom.h> // ROOT_TRandom
+#include <AliLog.h> // ALILOG_H
+#include "AliFMDBaseDigitizer.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(AliFMDBaseDigitizer)
+#if 0
+ ; // This is here to keep Emacs for indenting the next line
+#endif
+
+//____________________________________________________________________
+AliFMDBaseDigitizer::AliFMDBaseDigitizer()
+ : fRunLoader(0)
+{
+ // Default ctor - don't use it
+}
+
+//____________________________________________________________________
+AliFMDBaseDigitizer::AliFMDBaseDigitizer(AliRunDigitizer* manager)
+ : AliDigitizer(manager, "AliFMDBaseDigitizer", "FMD Digitizer base class"),
+ fRunLoader(0),
+ fEdep(AliFMDMap::kMaxDetectors,
+ AliFMDMap::kMaxRings,
+ AliFMDMap::kMaxSectors,
+ AliFMDMap::kMaxStrips)
+{
+ // Normal CTOR
+ AliDebug(1," processed");
+ SetShapingTime();
+}
+
+//____________________________________________________________________
+AliFMDBaseDigitizer::AliFMDBaseDigitizer(const Char_t* name,
+ const Char_t* title)
+ : AliDigitizer(name, title),
+ fRunLoader(0),
+ fEdep(AliFMDMap::kMaxDetectors,
+ AliFMDMap::kMaxRings,
+ AliFMDMap::kMaxSectors,
+ AliFMDMap::kMaxStrips)
+{
+ // Normal CTOR
+ AliDebug(1," processed");
+ SetShapingTime();
+}
+
+//____________________________________________________________________
+AliFMDBaseDigitizer::~AliFMDBaseDigitizer()
+{
+ // Destructor
+}
+
+//____________________________________________________________________
+Bool_t
+AliFMDBaseDigitizer::Init()
+{
+ // Initialization
+ AliFMDParameters::Instance()->Init();
+ return kTRUE;
+}
+
+
+//____________________________________________________________________
+UShort_t
+AliFMDBaseDigitizer::MakePedestal(UShort_t,
+ Char_t,
+ UShort_t,
+ UShort_t) const
+{
+ // Make a pedestal
+ return 0;
+}
+
+//____________________________________________________________________
+void
+AliFMDBaseDigitizer::SumContributions(AliFMD* fmd)
+{
+ // Sum energy deposited contributions from each hit in a cache
+ // (fEdep).
+ if (!fRunLoader)
+ Fatal("SumContributions", "no run loader");
+
+ // Clear array of deposited energies
+ fEdep.Reset();
+
+ // Get the FMD loader
+ AliLoader* inFMD = fRunLoader->GetLoader("FMDLoader");
+ // And load the hits
+ inFMD->LoadHits("READ");
+
+ // Get the tree of hits
+ TTree* hitsTree = inFMD->TreeH();
+ if (!hitsTree) {
+ // Try again
+ inFMD->LoadHits("READ");
+ hitsTree = inFMD->TreeH();
+ }
+
+ // Get the FMD 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
+ TClonesArray *fmdHits = fmd->Hits();
+
+ // Get number of entries in the tree
+ Int_t ntracks = Int_t(hitsTree->GetEntries());
+
+ AliFMDParameters* param = AliFMDParameters::Instance();
+ Int_t read = 0;
+ // Loop over the tracks in the
+ for (Int_t track = 0; track < ntracks; track++) {
+ // Read in entry number `track'
+ read += hitsBranch->GetEntry(track);
+
+ // Get the number of hits
+ Int_t nhits = fmdHits->GetEntries ();
+ for (Int_t hit = 0; hit < nhits; hit++) {
+ // Get the hit number `hit'
+ AliFMDHit* fmdHit =
+ static_cast<AliFMDHit*>(fmdHits->UncheckedAt(hit));
+
+ // Extract parameters
+ UShort_t detector = fmdHit->Detector();
+ Char_t ring = fmdHit->Ring();
+ 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'
+ if (param->IsDead(detector, ring, sector, strip)) {
+ AliDebug(5, Form("FMD%d%c[%2d,%3d] is marked as dead",
+ detector, ring, sector, strip));
+ continue;
+ }
+ // Check if strip is out-side read-out range
+ if (strip < minstrip || strip > maxstrip) {
+ AliDebug(5, Form("FMD%d%c[%2d,%3d] is outside range [%3d,%3d]",
+ detector, ring, sector, strip, minstrip, maxstrip));
+ continue;
+ }
+
+ // Give warning in case of double hit
+ if (fEdep(detector, ring, sector, strip).fEdep != 0)
+ AliDebug(5, Form("Double hit in %d%c(%d,%d)",
+ detector, ring, sector, strip));
+
+ // Sum energy deposition
+ fEdep(detector, ring, sector, strip).fEdep += edep;
+ fEdep(detector, ring, sector, strip).fN += 1;
+ // Add this to the energy deposited for this strip
+ } // hit loop
+ } // track loop
+ AliDebug(1, Form("Size of cache: %d bytes, read %d bytes",
+ sizeof(fEdep), read));
+}
+
+//____________________________________________________________________
+void
+AliFMDBaseDigitizer::DigitizeHits(AliFMD* fmd) const
+{
+ // For the stored energy contributions in the cache (fEdep), convert
+ // the energy signal to ADC counts, and store the created digit in
+ // the digits array (AliFMD::fDigits)
+ //
+ AliFMDGeometry* geometry = AliFMDGeometry::Instance();
+
+ TArrayI counts(3);
+ for (UShort_t detector=1; detector <= 3; detector++) {
+ // Get pointer to subdetector
+ AliFMDDetector* det = geometry->GetDetector(detector);
+ if (!det) continue;
+ for (UShort_t ringi = 0; ringi <= 1; ringi++) {
+ Char_t ring = ringi == 0 ? 'I' : 'O';
+ // Get pointer to Ring
+ AliFMDRing* r = det->GetRing(ring);
+ if (!r) continue;
+
+ // Get number of sectors
+ UShort_t nSectors = UShort_t(360. / r->GetTheta());
+ // Loop over the number of sectors
+ for (UShort_t sector = 0; sector < nSectors; sector++) {
+ // Get number of strips
+ UShort_t nStrips = r->GetNStrips();
+ // Loop over the stips
+ Float_t last = 0;
+ for (UShort_t strip = 0; strip < nStrips; strip++) {
+ // Reset the counter array to the invalid value -1
+ counts.Reset(-1);
+ // Reset the last `ADC' value when we've get to the end of a
+ // VA1_ALICE channel.
+ if (strip % 128 == 0) last = 0;
+
+ Float_t edep = fEdep(detector, ring, sector, strip).fEdep;
+ ConvertToCount(edep, last, detector, ring, sector, strip, counts);
+ last = edep;
+ AddDigit(fmd, detector, ring, sector, strip, edep,
+ UShort_t(counts[0]), Short_t(counts[1]),
+ Short_t(counts[2]));
+#if 0
+ // This checks if the digit created will give the `right'
+ // number of particles when reconstructed, using a naiive
+ // approach. It's here only as a quality check - nothing
+ // else.
+ CheckDigit(digit, fEdep(detector, ring, sector, strip).fN,
+ counts);
+#endif
+ } // Strip
+ } // Sector
+ } // Ring
+ } // Detector
+}
+
+//____________________________________________________________________
+void
+AliFMDBaseDigitizer::ConvertToCount(Float_t edep,
+ Float_t last,
+ UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip,
+ TArrayI& counts) const
+{
+ // Convert the total energy deposited to a (set of) ADC count(s).
+ //
+ // This is done by
+ //
+ // Energy_Deposited ALTRO_Channel_Size
+ // ADC = -------------------------- ------------------- + pedestal
+ // Energy_Deposition_Of_1_MIP VA1_ALICE_MIP_Range
+ //
+ // Energy_Deposited fAltroChannelSize
+ // = --------------------------------- ----------------- + pedestal
+ // 1.664 * Si_Thickness * Si_Density fVA1MipRange
+ //
+ //
+ // = Energy_Deposited * ConversionFactor + pedestal
+ //
+ // However, this is modified by the response function of the
+ // VA1_ALICE pre-amp. chip in case we are doing oversampling of the
+ // VA1_ALICE output.
+ //
+ // In that case, we get N=fSampleRate values of the ADC, and the
+ // `EnergyDeposited' is a function of which sample where are
+ // calculating the ADC for
+ //
+ // ADC_i = f(EnergyDeposited, i/N, Last) * ConversionFactor + pedestal
+ //
+ // where Last is the Energy deposited in the previous strip.
+ //
+ // Here, f is the shaping function of the VA1_ALICE. This is given
+ // by
+ //
+ // | (E - l) * (1 - exp(-B * t) + l if E > l
+ // f(E, t, l) = <
+ // | (l - E) * exp(-B * t) + E otherwise
+ //
+ //
+ // = E + (l - E) * ext(-B * t)
+ //
+ AliFMDParameters* param = AliFMDParameters::Instance();
+ Float_t convF = 1/param->GetPulseGain(detector,ring,sector,strip);
+ UShort_t ped = MakePedestal(detector,ring,sector,strip);
+ UInt_t maxAdc = param->GetAltroChannelSize();
+ UShort_t rate = param->GetSampleRate(detector,ring,sector,strip);
+ UShort_t size = param->GetAltroChannelSize();
+
+ // In case we don't oversample, just return the end value.
+ if (rate == 1) {
+ counts[0] = UShort_t(TMath::Min(edep * convF + ped, Float_t(size)));
+ return;
+ }
+
+ // Create a pedestal
+ Float_t b = fShapingTime;
+ for (Ssiz_t i = 0; i < rate; i++) {
+ Float_t t = Float_t(i) / rate;
+ Float_t s = edep + (last - edep) * TMath::Exp(-b * t);
+ counts[i] = UShort_t(TMath::Min(s * convF + ped, Float_t(maxAdc)));
+ }
+}
+
+
+
+//____________________________________________________________________
+//
+// EOF
+//
+
+
+
+
--- /dev/null
+#ifndef ALIFMDBASEDIGITIZER_H
+#define ALIFMDBASEDIGITIZER_H
+/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
+ * reserved.
+ *
+ * See cxx source for full Copyright notice
+ */
+// Classses to make Hits into digits and summable digits.
+//
+// Digits consists of
+// - Detector #
+// - Ring ID
+// - Sector #
+// - Strip #
+// - ADC count in this channel
+//
+// Summable digits consists of
+// - Detector #
+// - Ring ID
+// - Sector #
+// - Strip #
+// - Total energy deposited in the strip
+// - ADC count in this channel
+//
+/** @file AliFMDBaseDigitizer.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:38:26 2006
+ @brief FMD Digitizers declaration
+ @ingroup FMD_sim
+*/
+#ifndef ALIDIGITIZER_H
+# include <AliDigitizer.h>
+#endif
+#ifndef ALIRUNDIGITIZER_H
+# include <AliRunDigitizer.h>
+#endif
+#ifndef ALIFMDEdepMAP_H
+# include "AliFMDEdepMap.h"
+#endif
+//====================================================================
+class TClonesArray;
+class AliFMD;
+class AliLoader;
+class AliRunLoader;
+class AliFMDDigit;
+
+
+//====================================================================
+/** @class AliFMDBaseDigitizer AliFMDDigitizer.h <FMD/AliFMDDigitizer>
+ @brief Base class for digitizers.
+
+ This class contains the procedures simulation ADC signal for the
+ Forward Multiplicity detector : Hits->Digits and Hits->SDigits
+
+ Digits consists of
+ - Detector #
+ - Ring ID
+ - Sector #
+ - Strip #
+ - ADC count in this channel
+
+ Summable 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.
+ @verbatim
+ +---------------------+
+ | AliFMDBaseDigitizer |
+ +---------------------+
+ ^
+ |
+ +----------+---------+
+ | |
+ +-----------------+ +------------------+
+ | AliFMDDigitizer | | AliFMDSDigitizer |
+ +-----------------+ +------------------+
+ @endverbatim
+ These classes uses parameters fetched from the AliFMDParameters
+ manager.
+
+ The shaping function of the VA1 is generally given by
+ @f[
+ f(x) = A(1 - \exp(-Bx))
+ @f]
+ where A is the total charge collected in the pre-amp., and B is a
+ paramter that depends on the shaping time of the VA1 circut.
+
+ When simulating the shaping function of the VA1 pre-amp. chip, we
+ have to take into account, that the shaping function depends on
+ the previous value of read from the pre-amp.
+
+ That results in the following algorithm:
+ @code
+ last = 0;
+ for (i=0; i < n_pre_amp_charge; i++) {
+ charge = GetCharge(i);
+ if (last < charge)
+ f(t) = (charge - last) * (1 - exp(-B * t)) + last
+ else
+ f(t) = (last - charge) * exp(-B * t) + charge)
+ for (j=0; j < sample_rate; j++)
+ adc[j] = f(i / (# samples))
+ last = charge
+ }
+ @endcode
+ Here, the first loop is over all charges collected by the VA1
+ chip, and the @c sample_rate is how many times the ALTRO ADC
+ samples each of the 128 charges from the pre-amp.
+
+ The @c charge is the total charge @f$ Q@f$ collected by the VA1
+ pre-amplifier for a strip. @f$ Q@f$ is then given by
+ @f[
+ Q = \frac{E}{e}\frac{S}{r}
+ @f]
+ where @f$ E@f$ is the total energy deposited in a silicon strip,
+ @f$ R@f$ is the dynamic range of the VA1 pre-amp, @f$ e@f$ is the
+ energy deposited by a single MIP, and @f$ S@f$ ALTRO channel size
+ in each time step.
+
+ The energy deposited per MIP is given by
+ @f$
+ e = M \rho w
+ @f$
+ where @f$ M@f$ is the universal number
+ @f$ 1.664 \mbox{keV}\mbox{cm}^{2}\mbox{g}^{-1}@f$, @f$ \rho@f$ is
+ the density of silicon, and @f$ w@f$ is the depth of the silicon
+ sensor.
+
+ The final ADC count is given by
+ @f[
+ C' = C + P
+ @f]
+ where @f$ P@f$ is the (randomized) pedestal.
+
+ This class uses the class template AliFMDEdepMap to make an
+ internal cache of the energy deposted of the hits. The class
+ template is instantasized as
+
+ The first member of the values is the summed energy deposition in a
+ given strip, while the second member of the values is the number of
+ hits in a given strip. Using the second member, it's possible to
+ do some checks on just how many times a strip got hit, and what
+ kind of error we get in our reconstructed hits. Note, that this
+ information is currently not written to the digits tree. I think a
+ QA (Quality Assurance) digit tree is better suited for that task.
+ However, the information is there to be used in the future.
+ @ingroup FMD_sim
+ */
+class AliFMDBaseDigitizer : public AliDigitizer
+{
+public:
+ /** CTOR */
+ AliFMDBaseDigitizer();
+ /** Normal CTOR
+ @param manager Manager of digitization */
+ AliFMDBaseDigitizer(AliRunDigitizer * manager);
+ /** Normal ctor
+ @param name Name
+ @param title Title */
+ AliFMDBaseDigitizer(const Char_t* name, const Char_t* title);
+ /** DTOR */
+ virtual ~AliFMDBaseDigitizer();
+
+ /** Initialize */
+ virtual Bool_t Init();
+
+ /** The response shape of the VA1 shaping circuit is approximently
+ given by
+ @f[
+ f(x) = A(1 - \exp(-Bx))
+ @f]
+ where @f$ A@f$ is the total charge collected by the pre-amp.,
+ and @f$ B@f$ is parameter that depends on the shaping time of
+ the @b VA1 pre-amp. This member function sets the parameter @f$
+ B@f$
+ @param B */
+ void SetShapingTime(Float_t B=10) { fShapingTime = B; }
+ /** @return Get the shaping time */
+ Float_t GetShapingTime() const { return fShapingTime; }
+protected:
+ /** Sum energy deposited contributions from each hit in a cache
+ @param fmd Pointer to detector */
+ virtual void SumContributions(AliFMD* fmd);
+ /** For the stored energy contributions in the cache, convert the
+ energy signal to ADC counts, and store the created digit in
+ the digits array
+ @param fmd Pointer to detector */
+ virtual void DigitizeHits(AliFMD* fmd) const;
+ /** Convert the total energy deposited to a (set of) ADC count(s).
+ See also the class description for more details.
+ @param edep Total energy deposited in detector
+ @param last Last charge collected in previous VA1 channnel
+ @param detector Detector #
+ @param ring Ring ID
+ @param sector Sector #
+ @param strip Strip #
+ @param counts Array holding the counts on return */
+ virtual void ConvertToCount(Float_t edep,
+ Float_t last,
+ UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip,
+ TArrayI& counts) const;
+ /** Make a pedestal
+ @param detector Detector #
+ @param ring Ring ID
+ @param sector Sector #
+ @param strip Strip #
+ @return Pedestal value */
+ virtual UShort_t MakePedestal(UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip) const;
+ /** Add noise to each sample */
+ virtual void AddNoise(TArrayI&) const {}
+ /** Add a digit to output */
+ virtual void AddDigit(AliFMD* /* fmd */,
+ UShort_t /* detector */,
+ Char_t /* ring */,
+ UShort_t /* sector */,
+ UShort_t /* strip */,
+ Float_t /* edep */,
+ UShort_t /* count1 */,
+ Short_t /* count2 */,
+ Short_t /* count3 */) const {}
+
+ AliRunLoader* fRunLoader; //! Run loader
+ AliFMDEdepMap fEdep; // Cache of Energy from hits
+ Float_t fShapingTime; // Shaping profile parameter
+
+ /** Copy CTOR
+ @param o object to copy from */
+ AliFMDBaseDigitizer(const AliFMDBaseDigitizer& o)
+ : AliDigitizer(o) {}
+ /** Assignment operator
+ @return Reference to this object */
+ AliFMDBaseDigitizer& operator=(const AliFMDBaseDigitizer&) { return *this; }
+ ClassDef(AliFMDBaseDigitizer,2) // Base class for FMD digitizers
+};
+
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+// mode: C++
+// End:
+//
+//
+// EOF
+//
+
@author Christian Holm Christensen <cholm@nbi.dk>
@date Sun Mar 26 18:29:21 2006
@brief Make fake calibration data
+ @ingroup FMD_util
*/
//____________________________________________________________________
//
#include "AliFMDCalibStripRange.h" // ALIFMDCALIBSTRIPRANGE_H
#include <AliCDBManager.h> // ALICDBMANAGER_H
#include <AliCDBEntry.h> // ALICDBMANAGER_H
-#include <Riostream.h>
+//#include <Riostream.h>
#include <TSystem.h>
-#include <TMath.h>
+// #include <TMath.h>
#include <TROOT.h>
#include <TRandom.h>
fGain = (param->GetVA1MipRange() * param->GetEdepMip() / maxADC);
fThreshold = fThresholdFactor * param->GetEdepMip();
AliFMDCalibGain* gain = MakePulseGain();
- AliCDBId id(AliFMDParameters::fgkPulseGain, fRunMin, fRunMax);
+ AliCDBId id(AliFMDParameters::PulseGainPath(), fRunMin, fRunMax);
MAKE_META(meta);
meta->SetProperty("key1", gain);
cdb->Put(gain, id, meta);
fPedestalMin = TMath::Max(TMath::Min(fPedestalMin, maxADC), 0.F);
fPedestalMax = TMath::Max(TMath::Min(fPedestalMax, maxADC), fPedestalMin);
AliFMDCalibPedestal* pedestal = MakePedestal();
- AliCDBId id(AliFMDParameters::fgkPedestal, fRunMin, fRunMax);
+ AliCDBId id(AliFMDParameters::PedestalPath(), fRunMin, fRunMax);
MAKE_META(meta);
meta->SetProperty("key1", pedestal);
cdb->Put(pedestal, id, meta);
if (TESTBIT(fMask, kDeadMap)) {
fDeadChance = TMath::Max(TMath::Min(fDeadChance, 1.F), 0.F);
AliFMDCalibDeadMap* deadMap = MakeDeadMap();
- AliCDBId id(AliFMDParameters::fgkDead, fRunMin, fRunMax);
+ AliCDBId id(AliFMDParameters::DeadPath(), fRunMin, fRunMax);
MAKE_META(meta);
meta->SetProperty("key1", deadMap);
cdb->Put(deadMap, id, meta);
if (TESTBIT(fMask, kZeroSuppression)) {
fZeroThreshold = TMath::Min(fZeroThreshold, UShort_t(maxADC));
AliFMDCalibZeroSuppression* zeroSup = MakeZeroSuppression();
- AliCDBId id(AliFMDParameters::fgkZeroSuppression,
+ AliCDBId id(AliFMDParameters::ZeroSuppressionPath(),
fRunMin, fRunMax);
MAKE_META(meta);
meta->SetProperty("key1", zeroSup);
if (TESTBIT(fMask, kSampleRate)) {
fRate = TMath::Max(TMath::Min(fRate, UShort_t(8)), UShort_t(1));
AliFMDCalibSampleRate* rate = MakeSampleRate();
- AliCDBId id(AliFMDParameters::fgkSampleRate,fRunMin,fRunMax);
+ AliCDBId id(AliFMDParameters::SampleRatePath(),fRunMin,fRunMax);
MAKE_META(meta);
meta->SetProperty("key1", rate);
cdb->Put(rate, id, meta);
if (TESTBIT(fMask, kStripRange)) {
fRate = TMath::Max(TMath::Min(fRate, UShort_t(8)), UShort_t(1));
AliFMDCalibStripRange* range = MakeStripRange();
- AliCDBId id(AliFMDParameters::fgkStripRange,fRunMin,fRunMax);
+ AliCDBId id(AliFMDParameters::StripRangePath(),fRunMin,fRunMax);
MAKE_META(meta);
meta->SetProperty("key1", range);
cdb->Put(range, id, meta);
}
if (TESTBIT(fMask, kAltroMap)) {
AliFMDAltroMapping* altroMap = MakeAltroMap();
- AliCDBId id(AliFMDParameters::fgkAltroMap, fRunMin, fRunMax);
+ AliCDBId id(AliFMDParameters::AltroMapPath(), fRunMin, fRunMax);
MAKE_META(meta);
meta->SetProperty("key1", altroMap);
cdb->Put(altroMap, id, meta);
//__________________________________________________________________
AliFMDCalibGain*
-AliFMDCalibFaker::MakePulseGain()
+AliFMDCalibFaker::MakePulseGain() const
{
// Make the actual data
AliFMDCalibGain* gain = new AliFMDCalibGain;
//__________________________________________________________________
AliFMDCalibPedestal*
-AliFMDCalibFaker::MakePedestal()
+AliFMDCalibFaker::MakePedestal() const
{
// Make the actual data
AliFMDCalibPedestal* pedestal = new AliFMDCalibPedestal;
//__________________________________________________________________
AliFMDCalibDeadMap*
-AliFMDCalibFaker::MakeDeadMap()
+AliFMDCalibFaker::MakeDeadMap() const
{
// Make the actual data
AliFMDCalibDeadMap* deadmap = new AliFMDCalibDeadMap;
//__________________________________________________________________
AliFMDCalibZeroSuppression*
-AliFMDCalibFaker::MakeZeroSuppression()
+AliFMDCalibFaker::MakeZeroSuppression() const
{
// Make the actual data
AliFMDCalibZeroSuppression* zs = new AliFMDCalibZeroSuppression;
//__________________________________________________________________
AliFMDCalibSampleRate*
-AliFMDCalibFaker::MakeSampleRate()
+AliFMDCalibFaker::MakeSampleRate() const
{
+ // Make sample rates
AliFMDCalibSampleRate* sampleRate = new AliFMDCalibSampleRate;
for (UShort_t det = 1; det <= 3; det++) {
Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
//__________________________________________________________________
AliFMDCalibStripRange*
-AliFMDCalibFaker::MakeStripRange()
+AliFMDCalibFaker::MakeStripRange() const
{
+ // Make strip ranges
AliFMDCalibStripRange* striprange = new AliFMDCalibStripRange;
for (UShort_t det = 1; det <= 3; det++) {
Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
//__________________________________________________________________
AliFMDAltroMapping*
-AliFMDCalibFaker::MakeAltroMap()
+AliFMDCalibFaker::MakeAltroMap() const
{
+ // Make hardware mapping
AliFMDAltroMapping* m = new AliFMDAltroMapping;
return m;
}
@author Christian Holm Christensen <cholm@nbi.dk>
@date Sun Mar 26 18:29:36 2006
@brief Make fake calibration data
+ @ingroup FMD_util
*/
//____________________________________________________________________
//
// Class to make fake calibration parameters
+// Used for populating inital data base
+// Utility class
//
#ifndef ROOT_TTask
# include <TTask.h>
protected:
/** Make zero suppression parameters
@return Map of zero suppression */
- virtual AliFMDCalibZeroSuppression* MakeZeroSuppression();
+ virtual AliFMDCalibZeroSuppression* MakeZeroSuppression() const;
/** Make sample rate parameters
@return Map of sample rate */
- virtual AliFMDCalibSampleRate* MakeSampleRate();
+ virtual AliFMDCalibSampleRate* MakeSampleRate() const;
/** Make pedestal parameters
@return Map of pedestal */
- virtual AliFMDCalibPedestal* MakePedestal();
+ virtual AliFMDCalibPedestal* MakePedestal() const;
/** Make gain parameters
@return Map of gain */
- virtual AliFMDCalibGain* MakePulseGain();
+ virtual AliFMDCalibGain* MakePulseGain() const;
/** Make dead channel parameters
@return Map of dead channel */
- virtual AliFMDCalibDeadMap* MakeDeadMap();
+ virtual AliFMDCalibDeadMap* MakeDeadMap() const;
/** Make a hardware map
@return hardware map */
- virtual AliFMDAltroMapping* MakeAltroMap();
+ virtual AliFMDAltroMapping* MakeAltroMap() const;
/** Make a strip range
@return strip range map */
- virtual AliFMDCalibStripRange* MakeStripRange();
+ virtual AliFMDCalibStripRange* MakeStripRange() const;
Long_t fMask; // What to write
Float_t fGain; // Gain
Float_t fDeadChance; // Chance of dead channel
UShort_t fRate; // Sample rate
UShort_t fZeroThreshold; // Zero suppression threshold
- Int_t fRunMin;
- Int_t fRunMax;
- UShort_t fStripMin;
- UShort_t fStripMax;
+ Int_t fRunMin; // Min run number
+ Int_t fRunMax; // Max run number
+ UShort_t fStripMin; // Min strip read out
+ UShort_t fStripMax; // Max strip read out
ClassDef(AliFMDCalibFaker,0)
};
*/
//____________________________________________________________________
//
-//
+// Gain value and width for each strip in the FMD.
+// Foo
+// Bar
+// Baz
+// Gnus
//
#include "AliFMDCalibGain.h" // ALIFMDCALIBGAIN_H
//____________________________________________________________________
//____________________________________________________________________
AliFMDCalibGain::AliFMDCalibGain()
{
+ // CTOR
fValue.Reset(-1.);
fThreshold = -1.;
}
//____________________________________________________________________
AliFMDCalibGain::AliFMDCalibGain(const AliFMDCalibGain& o)
: TObject(o), fValue(o.fValue), fThreshold(o.fThreshold)
-{}
+{
+ // Copy CTOR
+}
//____________________________________________________________________
AliFMDCalibGain&
AliFMDCalibGain::operator=(const AliFMDCalibGain& o)
{
+ // Assignment operator
fValue = o.fValue;
fThreshold = o.fThreshold;
return (*this);
AliFMDCalibGain::Set(UShort_t det, Char_t ring, UShort_t sec,
UShort_t str, Float_t val)
{
+ // Set the value for a strip
if (fValue.CheckIndex(det, ring, sec, str) < 0) return;
fValue(det, ring, sec, str) = val;
}
AliFMDCalibGain::Value(UShort_t det, Char_t ring, UShort_t sec,
UShort_t str)
{
+ // Get the value for a strip
return fValue(det, ring, sec, str);
}
@date Sun Mar 26 18:30:16 2006
@brief Per strip gain calibration
*/
+// Gain value and width for each strip in the FMD.
+// Foo
+// Bar
+//
#ifndef ALIFMDFLOATMAP_H
# include <AliFMDFloatMap.h>
#endif
@author Christian Holm Christensen <cholm@nbi.dk>
@date Sun Mar 26 18:30:36 2006
@brief Per strip pedestal calibration
+ @ingroup FMD_base
*/
//____________________________________________________________________
//
-//
+// This class stores a pedestal and pedestal width for each strip in
+// the FMD detectors.
+// The values are stored as floats, since they may be results from a
+// fit.
+// Need to make algorithm that makes this data
//
#include "AliFMDCalibPedestal.h" // ALIFMDCALIBPEDESTAL_H
//____________________________________________________________________
//____________________________________________________________________
AliFMDCalibPedestal::AliFMDCalibPedestal()
{
+ // CTOR
fValue.Reset(-1.);
fWidth.Reset(-1.);
}
//____________________________________________________________________
AliFMDCalibPedestal::AliFMDCalibPedestal(const AliFMDCalibPedestal& o)
: TObject(o), fValue(o.fValue), fWidth(o.fWidth)
-{}
+{
+ // Copy Ctor
+}
//____________________________________________________________________
AliFMDCalibPedestal&
AliFMDCalibPedestal::operator=(const AliFMDCalibPedestal& o)
{
+ // Assignment operator
fValue = o.fValue;
fWidth = o.fWidth;
return (*this);
AliFMDCalibPedestal::Set(UShort_t det, Char_t ring, UShort_t sec,
UShort_t str, Float_t ped, Float_t pedW)
{
+ // set value and width for a strip
if (fValue.CheckIndex(det, ring, sec, str) < 0) return;
fValue(det, ring, sec, str) = ped;
fWidth(det, ring, sec, str) = pedW;
AliFMDCalibPedestal::Value(UShort_t det, Char_t ring, UShort_t sec,
UShort_t str)
{
+ // Get pedestal value for a strip
return fValue(det, ring, sec, str);
}
AliFMDCalibPedestal::Width(UShort_t det, Char_t ring, UShort_t sec,
UShort_t str)
{
+ // Get pedestal width for a strip
return fWidth(det, ring, sec, str);
}
*
* See cxx source for full Copyright notice
*/
+//____________________________________________________________________
+//
+// This class stores a pedestal and pedestal width for each strip in
+// the FMD detectors.
+// The values are stored as floats, since they may be results from a
+// fit.
+// Need to make algorithm that makes this data
/** @file AliFMDCalibPedestal.h
@author Christian Holm Christensen <cholm@nbi.dk>
@date Sun Mar 26 18:30:51 2006
@brief Per strip pedestal calibration
+ @ingroup FMD_base
*/
#ifndef ALIFMDFLOATMAP_H
# include <AliFMDFloatMap.h>
*/
//____________________________________________________________________
//
-//
+// This class stores the sample rate (that is, how many times the
+// ATLRO's sample each VA1 channel). In principle these can be
+// controlled per half ring, but in real life it's most likely that
+// this value will be the same for all detectors. This value must be
+// retrived from DCS or the like.
//
#include "AliFMDCalibSampleRate.h" // ALIFMDCALIBGAIN_H
#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
: fRates(AliFMDMap::kMaxDetectors, AliFMDMap::kMaxRings, 2, 1)
// fRates(3)
{
+ // CTOR
fRates.Reset(1);
}
//____________________________________________________________________
AliFMDCalibSampleRate::AliFMDCalibSampleRate(const AliFMDCalibSampleRate& o)
: TObject(o), fRates(o.fRates)
-{}
+{
+ // Copy ctor
+}
//____________________________________________________________________
AliFMDCalibSampleRate&
AliFMDCalibSampleRate::operator=(const AliFMDCalibSampleRate& o)
{
+ // Assignment operator
fRates = o.fRates;
return (*this);
}
AliFMDCalibSampleRate::Set(UShort_t det, Char_t ring,
UShort_t sector, UShort_t, UShort_t rate)
{
+ // Set values. Strip argument is ignored
UInt_t nSec = (ring == 'I' ? 20 : 40);
UInt_t board = sector / nSec;
fRates(det, ring, board, 0) = rate;
AliFMDCalibSampleRate::Rate(UShort_t det, Char_t ring,
UShort_t sec, UShort_t) const
{
+ // Get the sample rate
UInt_t nSec = (ring == 'I' ? 20 : 40);
UInt_t board = sec / nSec;
AliDebug(10, Form("Getting sample rate for FMD%d%c[%2d,0] (board %d)",
*
* See cxx source for full Copyright notice
*/
+//____________________________________________________________________
+//
+// This class stores the sample rate (that is, how many times the
+// ATLRO's sample each VA1 channel). In principle these can be
+// controlled per half ring, but in real life it's most likely that
+// this value will be the same for all detectors. This value must be
+// retrived from DCS or the like.
+//
/** @file AliFMDCalibSampleRate.h
@author Christian Holm Christensen <cholm@nbi.dk>
@date Sun Mar 26 18:32:14 2006
@brief Per digitizer card pulser calibration
-
+ @ingroup FMD_base
*/
#ifndef ROOT_TObject
# include <TObject.h>
UShort_t Rate(UShort_t det, Char_t ring, UShort_t sec, UShort_t str=0) const;
protected:
// TArrayI fRates; // Sample rates
- AliFMDUShortMap fRates;
+ AliFMDUShortMap fRates; // Sample rates
ClassDef(AliFMDCalibSampleRate,2); // Sample rates
};
*/
//____________________________________________________________________
//
-//
+// This class stores which strips are read-out.
+// In principle this can be set for each half-ring.
+// However, in real life, all the detectors will probably read out all
+// strips, and dead areas can be handled off-line.
+// This information comes from DCS or the like.
//
#include "AliFMDCalibStripRange.h" // ALIFMDCALIBGAIN_H
#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
//____________________________________________________________________
AliFMDCalibStripRange::AliFMDCalibStripRange()
- : fRates(AliFMDMap::kMaxDetectors, AliFMDMap::kMaxRings, 2, 1)
- // fRates(3)
+ : fRanges(AliFMDMap::kMaxDetectors, AliFMDMap::kMaxRings, 2, 1)
+ // fRanges(3)
{
- fRates.Reset(1);
+ // CTOR
+ fRanges.Reset(1);
}
//____________________________________________________________________
AliFMDCalibStripRange::AliFMDCalibStripRange(const AliFMDCalibStripRange& o)
- : TObject(o), fRates(o.fRates)
-{}
+ : TObject(o), fRanges(o.fRanges)
+{
+ // Copy CTOR
+}
//____________________________________________________________________
AliFMDCalibStripRange&
AliFMDCalibStripRange::operator=(const AliFMDCalibStripRange& o)
{
- fRates = o.fRates;
+ // Assignement operator
+ fRanges = o.fRanges;
return (*this);
}
UShort_t sector, UShort_t, UShort_t min,
UShort_t max)
{
+ // Set the min and max for a half-ring
UInt_t nSec = (ring == 'I' ? 20 : 40);
UInt_t board = sector / nSec;
- fRates(det, ring, board, 0) = ((max & 0x7f) << 8) + (min & 0x7f);
+ fRanges(det, ring, board, 0) = ((max & 0x7f) << 8) + (min & 0x7f);
}
//____________________________________________________________________
AliFMDCalibStripRange::Min(UShort_t det, Char_t ring,
UShort_t sec, UShort_t) const
{
+ // Get the min for a half-ring
UInt_t nSec = (ring == 'I' ? 20 : 40);
UInt_t board = sec / nSec;
- return (fRates(det, ring, board, 0) & 0x7f);
+ return (fRanges(det, ring, board, 0) & 0x7f);
}
//____________________________________________________________________
AliFMDCalibStripRange::Max(UShort_t det, Char_t ring,
UShort_t sec, UShort_t) const
{
+ // Get the max for a half-ring
UInt_t nSec = (ring == 'I' ? 20 : 40);
UInt_t board = sec / nSec;
- return ((fRates(det, ring, board, 0) >> 8) & 0x7f);
+ return ((fRanges(det, ring, board, 0) >> 8) & 0x7f);
}
//____________________________________________________________________
*
* See cxx source for full Copyright notice
*/
+//____________________________________________________________________
+//
+// This class stores which strips are read-out.
+// In principle this can be set for each half-ring.
+// However, in real life, all the detectors will probably read out all
+// strips, and dead areas can be handled off-line.
+// This information comes from DCS or the like.
+//
/** @file AliFMDCalibStripRange.h
@author Christian Holm Christensen <cholm@nbi.dk>
@date Sun Mar 26 18:32:14 2006
@brief Per digitizer card pulser calibration
+ @ingroup FMD_base
*/
#ifndef ROOT_TObject
# include <TObject.h>
UShort_t Max(UShort_t det, Char_t ring, UShort_t sec, UShort_t str=0) const;
protected:
// TArrayI fRates; // Sample rates
- AliFMDUShortMap fRates;
+ AliFMDUShortMap fRanges; // Min max
ClassDef(AliFMDCalibStripRange,1); // Sample rates
};
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:36:27 2006
@brief Sub-detector base class implementation
+ @ingroup FMD_base
*/
//____________________________________________________________________
#include "AliLog.h" // ALILOG_H
#include <TGeoManager.h> // ROOT_TGeoManager
#include <TGeoMatrix.h> // ROOT_TGeoMatrix
-#include <TMath.h> // ROOT_TMath
+// #include <TMath.h> // ROOT_TMath
//====================================================================
ClassImp(AliFMDDetector)
Bool_t
AliFMDDetector::HasAllTransforms(Char_t ring) const
{
+ // Check if we got all transformations for a given ring. Return
+ // true in that case.
AliFMDRing* r = GetRing(ring);
if (!r) return kTRUE;
TObjArray* matricies = (r == fInner ? fInnerTransforms : fOuterTransforms);
void
AliFMDDetector::InitTransformations()
{
+ // Find all local<->global transformations for this detector.
if ((!fInner || (fInner && fInnerTransforms)) &&
(!fOuter || (fOuter && fOuterTransforms))) {
AliDebug(5, Form("Transforms for FMD%d already registered", fId));
*
* See cxx source for full Copyright notice
*/
+//__________________________________________________________________
+//
+// Utility class to help implement the FMD geometry. This provides
+// the interface for the concrete geometry implementations of the FMD
+// sub-detectors.
/** @file AliFMDDetector.h
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:36:27 2006
@brief Sub-detector base class declaration
+ @ingroup FMD_base
*/
#ifndef ROOT_TNamed
# include <TNamed.h>
#include "Riostream.h" // ROOT_Riostream
#include <TString.h>
-//====================================================================
-ClassImp(AliFMDBaseDigit)
-#if 0
- ; // This is here to keep Emacs from indenting the next line
-#endif
-
-//____________________________________________________________________
-AliFMDBaseDigit::AliFMDBaseDigit()
- : fDetector(0),
- fRing('\0'),
- fSector(0),
- fStrip(0)
-{}
-
-//____________________________________________________________________
-AliFMDBaseDigit::AliFMDBaseDigit(UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip)
- : fDetector(detector),
- fRing(ring),
- fSector(sector),
- fStrip(strip)
-{
- //
- // Creates a base data digit object
- //
- // Parameters
- //
- // detector Detector # (1, 2, or 3)
- // ring Ring ID ('I' or 'O')
- // sector Sector # (For inner/outer rings: 0-19/0-39)
- // strip Strip # (For inner/outer rings: 0-511/0-255)
-}
-
-//____________________________________________________________________
-void
-AliFMDBaseDigit::Print(Option_t* /* option*/) const
-{
- // Print digit to standard out
- cout << ClassName() << ": FMD" << fDetector << fRing << "["
- << setw(3) << fSector << ","
- << setw(3) << fStrip << "]"
- << flush;
-}
-
-//____________________________________________________________________
-const char*
-AliFMDBaseDigit::GetName() const
-{
- static TString n;
- n = Form("FMD%d%c[%2d,%3d]", fDetector, fRing, fSector, fStrip);
- return n.Data();
-}
-
//====================================================================
ClassImp(AliFMDDigit)
: fCount1(0),
fCount2(-1),
fCount3(-1)
-{}
+{
+ // CTOR
+}
//____________________________________________________________________
AliFMDDigit::AliFMDDigit(UShort_t detector,
const char*
AliFMDDigit::GetTitle() const
{
+ // Get the title
static TString t;
t = Form("ADC: %d", Counts());
return t.Data();
<< Counts() << endl;
}
-//====================================================================
-ClassImp(AliFMDSDigit)
-
-//____________________________________________________________________
-AliFMDSDigit::AliFMDSDigit()
- : fEdep(0),
- fCount1(0),
- fCount2(-1),
- fCount3(-1)
-{}
-
-//____________________________________________________________________
-AliFMDSDigit::AliFMDSDigit(UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- Float_t edep,
- UShort_t count1,
- Short_t count2,
- Short_t count3)
- : AliFMDBaseDigit(detector, ring, sector, strip),
- fEdep(edep),
- fCount1(count1),
- fCount2(count2),
- fCount3(count3)
-{
- //
- // Creates a real data digit object
- //
- // Parameters
- //
- // detector Detector # (1, 2, or 3)
- // ring Ring ID ('I' or 'O')
- // sector Sector # (For inner/outer rings: 0-19/0-39)
- // strip Strip # (For inner/outer rings: 0-511/0-255)
- // edep Total energy deposited
- // count1 ADC count (a 10-bit word)
- // count2 ADC count (a 10-bit word) -1 if not used
- // count3 ADC count (a 10-bit word) -1 if not used
-}
-
-//____________________________________________________________________
-void
-AliFMDSDigit::Print(Option_t* /* option*/) const
-{
- // Print digit to standard out
- AliFMDBaseDigit::Print();
- cout << "\t" << fEdep << " -> "
- << fCount1 << " (+ " << fCount2 << " + " << fCount2 << ") = "
- << Counts() << endl;
-}
-
//____________________________________________________________________
//
// EOF
// AliFMDDigit - Normal (smeared) digit
// AliFMDSDigit - Summable (non-smeared) digit
//
-#ifndef ROOT_TObject
-# include <TObject.h>
+#ifndef ALIFMDBASEDIGIT_H
+# include <AliFMDBaseDigit.h>
#endif
-//____________________________________________________________________
-/** @class AliFMDBaseDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
- @brief base class for digits
- @ingroup FMD_base
- */
-class AliFMDBaseDigit : public TObject
-{
-public:
- /** CTOR */
- AliFMDBaseDigit();
- /** Constrctor
- @param detector Detector
- @param ring Ring
- @param sector Sector
- @param strip Strip */
- AliFMDBaseDigit(UShort_t detector,
- Char_t ring='\0',
- UShort_t sector=0,
- UShort_t strip=0);
- /** DTOR */
- virtual ~AliFMDBaseDigit() {}
- /** @return Detector # */
- UShort_t Detector() const { return fDetector; }
- /** @return Ring ID */
- Char_t Ring() const { return fRing; }
- /** @return sector # */
- UShort_t Sector() const { return fSector; }
- /** @return strip # */
- UShort_t Strip() const { return fStrip; }
- /** Print information
- @param opt Not used */
- virtual void Print(Option_t* opt="") const;
- /** @return Name */
- const char* GetName() const;
-protected:
- UShort_t fDetector; // (Sub) Detector # (1,2, or 3)
- Char_t fRing; // Ring ID ('I' or 'O')
- UShort_t fSector; // Sector # (phi division)
- UShort_t fStrip; // Strip # (radial division)
- ClassDef(AliFMDBaseDigit, 1) // Base class for FMD digits
-};
-
//____________________________________________________________________
/** @class AliFMDDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
@brief class for digits
return -1;
}
-//____________________________________________________________________
-/** @class AliFMDSDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
- @brief class for summable digits
- @ingroup FMD_base
- */
-class AliFMDSDigit : public AliFMDBaseDigit
-{
-public:
- /** CTOR */
- AliFMDSDigit();
- /** Constrctor
- @param detector Detector
- @param ring Ring
- @param sector Sector
- @param strip Strip
- @param edep Energy deposited
- @param count ADC (first sample)
- @param count2 ADC (second sample, or -1 if not used)
- @param count3 ADC (third sample, or -1 if not used) */
- AliFMDSDigit(UShort_t detector,
- Char_t ring='\0',
- UShort_t sector=0,
- UShort_t strip=0,
- Float_t edep=0,
- UShort_t count=0,
- Short_t count2=-1,
- Short_t count3=-1);
- /** DTOR */
- virtual ~AliFMDSDigit() {}
- /** @return ADC count (first sample) */
- UShort_t Count1() const { return fCount1; }
- /** @return ADC count (second sample, or -1 if not used) */
- Short_t Count2() const { return fCount2; }
- /** @return ADC count (third sample, or -1 if not used) */
- Short_t Count3() const { return fCount3; }
- /** @return Canonical ADC counts */
- UShort_t Counts() const;
- /** @return Energy deposited */
- Float_t Edep() const { return fEdep; }
- /** Print info
- @param opt Not used */
- void Print(Option_t* opt="") const;
-protected:
- Float_t fEdep; // Energy deposited
- UShort_t fCount1; // Digital signal
- Short_t fCount2; // Digital signal (-1 if not used)
- Short_t fCount3; // Digital signal (-1 if not used)
- ClassDef(AliFMDSDigit,1) // Summable FMD digit
-};
-
-inline UShort_t
-AliFMDSDigit::Counts() const
-{
- return fCount1
- + (fCount2 >= 0 ? fCount2 : 0)
- + (fCount3 >= 0 ? fCount3 : 0);
-}
-
-
#endif
//____________________________________________________________________
//
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:38:26 2006
@brief FMD Digitizers implementation
+ @ingroup FMD_sim
*/
//////////////////////////////////////////////////////////////////////////////
//
//
#include <TTree.h> // ROOT_TTree
-#include <TRandom.h> // ROOT_TRandom
+//#include <TRandom.h> // ROOT_TRandom
#include <AliLog.h> // ALILOG_H
#include "AliFMDDigitizer.h" // ALIFMDDIGITIZER_H
#include "AliFMD.h" // ALIFMD_H
#include <AliLoader.h> // ALILOADER_H
#include <AliRunLoader.h> // ALIRUNLOADER_H
-//====================================================================
-ClassImp(AliFMDBaseDigitizer)
-#if 0
- ; // This is here to keep Emacs for indenting the next line
-#endif
-
-//____________________________________________________________________
-AliFMDBaseDigitizer::AliFMDBaseDigitizer()
- : fRunLoader(0)
-{
- // Default ctor - don't use it
-}
-
-//____________________________________________________________________
-AliFMDBaseDigitizer::AliFMDBaseDigitizer(AliRunDigitizer* manager)
- : AliDigitizer(manager, "AliFMDBaseDigitizer", "FMD Digitizer base class"),
- fRunLoader(0),
- fEdep(AliFMDMap::kMaxDetectors,
- AliFMDMap::kMaxRings,
- AliFMDMap::kMaxSectors,
- AliFMDMap::kMaxStrips)
-{
- // Normal CTOR
- AliDebug(1," processed");
- SetShapingTime();
-}
-
-//____________________________________________________________________
-AliFMDBaseDigitizer::AliFMDBaseDigitizer(const Char_t* name,
- const Char_t* title)
- : AliDigitizer(name, title),
- fRunLoader(0),
- fEdep(AliFMDMap::kMaxDetectors,
- AliFMDMap::kMaxRings,
- AliFMDMap::kMaxSectors,
- AliFMDMap::kMaxStrips)
-{
- // Normal CTOR
- AliDebug(1," processed");
- SetShapingTime();
-}
-
-//____________________________________________________________________
-AliFMDBaseDigitizer::~AliFMDBaseDigitizer()
-{
- // Destructor
-}
-
-//____________________________________________________________________
-Bool_t
-AliFMDBaseDigitizer::Init()
-{
- // Initialization
- AliFMDParameters::Instance()->Init();
- return kTRUE;
-}
-
-
-//____________________________________________________________________
-UShort_t
-AliFMDBaseDigitizer::MakePedestal(UShort_t,
- Char_t,
- UShort_t,
- UShort_t) const
-{
- return 0;
-}
-
-//____________________________________________________________________
-void
-AliFMDBaseDigitizer::SumContributions(AliFMD* fmd)
-{
- // Sum energy deposited contributions from each hit in a cache
- // (fEdep).
- if (!fRunLoader)
- Fatal("SumContributions", "no run loader");
-
- // Clear array of deposited energies
- fEdep.Reset();
-
- // Get the FMD loader
- AliLoader* inFMD = fRunLoader->GetLoader("FMDLoader");
- // And load the hits
- inFMD->LoadHits("READ");
-
- // Get the tree of hits
- TTree* hitsTree = inFMD->TreeH();
- if (!hitsTree) {
- // Try again
- inFMD->LoadHits("READ");
- hitsTree = inFMD->TreeH();
- }
-
- // Get the FMD 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
- TClonesArray *fmdHits = fmd->Hits();
-
- // Get number of entries in the tree
- Int_t ntracks = Int_t(hitsTree->GetEntries());
-
- AliFMDParameters* param = AliFMDParameters::Instance();
- Int_t read = 0;
- // Loop over the tracks in the
- for (Int_t track = 0; track < ntracks; track++) {
- // Read in entry number `track'
- read += hitsBranch->GetEntry(track);
-
- // Get the number of hits
- Int_t nhits = fmdHits->GetEntries ();
- for (Int_t hit = 0; hit < nhits; hit++) {
- // Get the hit number `hit'
- AliFMDHit* fmdHit =
- static_cast<AliFMDHit*>(fmdHits->UncheckedAt(hit));
-
- // Extract parameters
- UShort_t detector = fmdHit->Detector();
- Char_t ring = fmdHit->Ring();
- 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'
- if (param->IsDead(detector, ring, sector, strip)) {
- AliDebug(5, Form("FMD%d%c[%2d,%3d] is marked as dead",
- detector, ring, sector, strip));
- continue;
- }
- // Check if strip is out-side read-out range
- if (strip < minstrip || strip > maxstrip) {
- AliDebug(5, Form("FMD%d%c[%2d,%3d] is outside range [%3d,%3d]",
- detector, ring, sector, strip, minstrip, maxstrip));
- continue;
- }
-
- // Give warning in case of double hit
- if (fEdep(detector, ring, sector, strip).fEdep != 0)
- AliDebug(5, Form("Double hit in %d%c(%d,%d)",
- detector, ring, sector, strip));
-
- // Sum energy deposition
- fEdep(detector, ring, sector, strip).fEdep += edep;
- fEdep(detector, ring, sector, strip).fN += 1;
- // Add this to the energy deposited for this strip
- } // hit loop
- } // track loop
- AliDebug(1, Form("Size of cache: %d bytes, read %d bytes",
- sizeof(fEdep), read));
-}
-
-//____________________________________________________________________
-void
-AliFMDBaseDigitizer::DigitizeHits(AliFMD* fmd) const
-{
- // For the stored energy contributions in the cache (fEdep), convert
- // the energy signal to ADC counts, and store the created digit in
- // the digits array (AliFMD::fDigits)
- //
- AliFMDGeometry* geometry = AliFMDGeometry::Instance();
-
- TArrayI counts(3);
- for (UShort_t detector=1; detector <= 3; detector++) {
- // Get pointer to subdetector
- AliFMDDetector* det = geometry->GetDetector(detector);
- if (!det) continue;
- for (UShort_t ringi = 0; ringi <= 1; ringi++) {
- Char_t ring = ringi == 0 ? 'I' : 'O';
- // Get pointer to Ring
- AliFMDRing* r = det->GetRing(ring);
- if (!r) continue;
-
- // Get number of sectors
- UShort_t nSectors = UShort_t(360. / r->GetTheta());
- // Loop over the number of sectors
- for (UShort_t sector = 0; sector < nSectors; sector++) {
- // Get number of strips
- UShort_t nStrips = r->GetNStrips();
- // Loop over the stips
- Float_t last = 0;
- for (UShort_t strip = 0; strip < nStrips; strip++) {
- // Reset the counter array to the invalid value -1
- counts.Reset(-1);
- // Reset the last `ADC' value when we've get to the end of a
- // VA1_ALICE channel.
- if (strip % 128 == 0) last = 0;
-
- Float_t edep = fEdep(detector, ring, sector, strip).fEdep;
- ConvertToCount(edep, last, detector, ring, sector, strip, counts);
- last = edep;
- AddDigit(fmd, detector, ring, sector, strip, edep,
- UShort_t(counts[0]), Short_t(counts[1]),
- Short_t(counts[2]));
-#if 0
- // This checks if the digit created will give the `right'
- // number of particles when reconstructed, using a naiive
- // approach. It's here only as a quality check - nothing
- // else.
- CheckDigit(digit, fEdep(detector, ring, sector, strip).fN,
- counts);
-#endif
- } // Strip
- } // Sector
- } // Ring
- } // Detector
-}
-
-//____________________________________________________________________
-void
-AliFMDBaseDigitizer::ConvertToCount(Float_t edep,
- Float_t last,
- UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- TArrayI& counts) const
-{
- // Convert the total energy deposited to a (set of) ADC count(s).
- //
- // This is done by
- //
- // Energy_Deposited ALTRO_Channel_Size
- // ADC = -------------------------- ------------------- + pedestal
- // Energy_Deposition_Of_1_MIP VA1_ALICE_MIP_Range
- //
- // Energy_Deposited fAltroChannelSize
- // = --------------------------------- ----------------- + pedestal
- // 1.664 * Si_Thickness * Si_Density fVA1MipRange
- //
- //
- // = Energy_Deposited * ConversionFactor + pedestal
- //
- // However, this is modified by the response function of the
- // VA1_ALICE pre-amp. chip in case we are doing oversampling of the
- // VA1_ALICE output.
- //
- // In that case, we get N=fSampleRate values of the ADC, and the
- // `EnergyDeposited' is a function of which sample where are
- // calculating the ADC for
- //
- // ADC_i = f(EnergyDeposited, i/N, Last) * ConversionFactor + pedestal
- //
- // where Last is the Energy deposited in the previous strip.
- //
- // Here, f is the shaping function of the VA1_ALICE. This is given
- // by
- //
- // | (E - l) * (1 - exp(-B * t) + l if E > l
- // f(E, t, l) = <
- // | (l - E) * exp(-B * t) + E otherwise
- //
- //
- // = E + (l - E) * ext(-B * t)
- //
- AliFMDParameters* param = AliFMDParameters::Instance();
- Float_t convF = 1/param->GetPulseGain(detector,ring,sector,strip);
- UShort_t ped = MakePedestal(detector,ring,sector,strip);
- UInt_t maxAdc = param->GetAltroChannelSize();
- UShort_t rate = param->GetSampleRate(detector,ring,sector,strip);
- UShort_t size = param->GetAltroChannelSize();
-
- // In case we don't oversample, just return the end value.
- if (rate == 1) {
- counts[0] = UShort_t(TMath::Min(edep * convF + ped, Float_t(size)));
- return;
- }
-
- // Create a pedestal
- Float_t b = fShapingTime;
- for (Ssiz_t i = 0; i < rate; i++) {
- Float_t t = Float_t(i) / rate;
- Float_t s = edep + (last - edep) * TMath::Exp(-b * t);
- counts[i] = UShort_t(TMath::Min(s * convF + ped, Float_t(maxAdc)));
- }
-}
-
-
//====================================================================
ClassImp(AliFMDDigitizer)
mips, nhits);
}
-//====================================================================
-ClassImp(AliFMDSDigitizer)
-
-//____________________________________________________________________
-AliFMDSDigitizer::AliFMDSDigitizer()
-{
- // Default ctor - don't use it
-}
-
-//____________________________________________________________________
-AliFMDSDigitizer::AliFMDSDigitizer(const Char_t* headerFile,
- const Char_t* /* sdigfile */)
- : AliFMDBaseDigitizer("FMDSDigitizer", "FMD SDigitizer")
-{
- // Normal CTOR
- AliDebug(1," processed");
-
- fRunLoader = AliRunLoader::GetRunLoader(); // Open(headerFile);
- if (!fRunLoader)
- Fatal("AliFMDSDigitizer", "cannot open session, header file '%s'",
- 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();
-}
-
-//____________________________________________________________________
-void
-AliFMDSDigitizer::Exec(Option_t*)
-{
- // Get the output manager
- if (!fRunLoader) {
- Error("Exec", "Run loader is not set");
- return;
- }
- if (!fRunLoader->GetAliRun()) fRunLoader->LoadgAlice();
- if (!fRunLoader->TreeE()) fRunLoader->LoadHeader();
-
- AliLoader* fmdLoader = fRunLoader->GetLoader("FMDLoader");
- if (!fmdLoader) Fatal("Exec", "no FMD loader");
-
- // 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 nEvents = Int_t(fRunLoader->TreeE()->GetEntries());
- for (Int_t event = 0; event < nEvents; event++) {
- AliDebug(1,Form(" Digitizing event number %d", event));
- // Get the current loader
- fRunLoader->GetEvent(event);
-
- if (!fmdLoader->TreeS()) fmdLoader->MakeTree("S");
- // Make a branch
- fmd->MakeBranch("S");
-
- // Cache contriutions
- SumContributions(fmd);
-
- // Digitize the event
- DigitizeHits(fmd);
-
- fmdLoader->TreeS()->Reset();
- fmdLoader->TreeS()->Fill();
- fmdLoader->WriteSDigits("OVERWRITE");
- }
-}
-
-//____________________________________________________________________
-void
-AliFMDSDigitizer::AddDigit(AliFMD* fmd,
- UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- Float_t edep,
- UShort_t count1,
- Short_t count2,
- Short_t count3) const
-{
- // Add a summable digit
- fmd->AddSDigitByFields(detector, ring, sector, strip, edep,
- count1, count2, count3);
-}
-
-
-
//____________________________________________________________________
//
// EOF
*
* See cxx source for full Copyright notice
*/
+// Classses to make Hits into digits and summable digits.
+//
+// Digits consists of
+// - Detector #
+// - Ring ID
+// - Sector #
+// - Strip #
+// - ADC count in this channel
+//
+// Summable digits consists of
+// - Detector #
+// - Ring ID
+// - Sector #
+// - Strip #
+// - Total energy deposited in the strip
+// - ADC count in this channel
+//
/** @file AliFMDDigitizer.h
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:38:26 2006
@brief FMD Digitizers declaration
+ @ingroup FMD_sim
*/
-#ifndef ALIDIGITIZER_H
-# include <AliDigitizer.h>
-#endif
-#ifndef ALIRUNDIGITIZER_H
-# include <AliRunDigitizer.h>
-#endif
-#ifndef ALIFMDEdepMAP_H
-# include "AliFMDEdepMap.h"
+#ifndef ALIFMDBASEDIGITIZER_H
+# include <AliFMDBaseDigitizer.h>
#endif
-#ifndef __UTILITY__
-# include <utility>
-#endif
-// #ifndef ROOT_TArrayF
-// # include <TArrayF.h>
-// #endif
//====================================================================
class TClonesArray;
class AliFMDDigit;
-//====================================================================
-/** @class AliFMDBaseDigitizer AliFMDDigitizer.h <FMD/AliFMDDigitizer>
- @brief Base class for digitizers.
-
- This class contains the procedures simulation ADC signal for the
- Forward Multiplicity detector : Hits->Digits and Hits->SDigits
-
- Digits consists of
- - Detector #
- - Ring ID
- - Sector #
- - Strip #
- - ADC count in this channel
-
- Summable 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.
- @verbatim
- +---------------------+
- | AliFMDBaseDigitizer |
- +---------------------+
- ^
- |
- +----------+---------+
- | |
- +-----------------+ +------------------+
- | AliFMDDigitizer | | AliFMDSDigitizer |
- +-----------------+ +------------------+
- @endverbatim
- These classes uses parameters fetched from the AliFMDParameters
- manager.
-
- The shaping function of the VA1 is generally given by
- @f[
- f(x) = A(1 - \exp(-Bx))
- @f]
- where A is the total charge collected in the pre-amp., and B is a
- paramter that depends on the shaping time of the VA1 circut.
-
- When simulating the shaping function of the VA1 pre-amp. chip, we
- have to take into account, that the shaping function depends on
- the previous value of read from the pre-amp.
-
- That results in the following algorithm:
- @code
- last = 0;
- for (i=0; i < n_pre_amp_charge; i++) {
- charge = GetCharge(i);
- if (last < charge)
- f(t) = (charge - last) * (1 - exp(-B * t)) + last
- else
- f(t) = (last - charge) * exp(-B * t) + charge)
- for (j=0; j < sample_rate; j++)
- adc[j] = f(i / (# samples))
- last = charge
- }
- @endcode
- Here, the first loop is over all charges collected by the VA1
- chip, and the @c sample_rate is how many times the ALTRO ADC
- samples each of the 128 charges from the pre-amp.
-
- The @c charge is the total charge @f$ Q@f$ collected by the VA1
- pre-amplifier for a strip. @f$ Q@f$ is then given by
- @f[
- Q = \frac{E}{e}\frac{S}{r}
- @f]
- where @f$ E@f$ is the total energy deposited in a silicon strip,
- @f$ R@f$ is the dynamic range of the VA1 pre-amp, @f$ e@f$ is the
- energy deposited by a single MIP, and @f$ S@f$ ALTRO channel size
- in each time step.
-
- The energy deposited per MIP is given by
- @f$
- e = M \rho w
- @f$
- where @f$ M@f$ is the universal number
- @f$ 1.664 \mbox{keV}\mbox{cm}^{2}\mbox{g}^{-1}@f$, @f$ \rho@f$ is
- the density of silicon, and @f$ w@f$ is the depth of the silicon
- sensor.
-
- The final ADC count is given by
- @f[
- C' = C + P
- @f]
- where @f$ P@f$ is the (randomized) pedestal.
-
- This class uses the class template AliFMDEdepMap to make an
- internal cache of the energy deposted of the hits. The class
- template is instantasized as
-
- The first member of the values is the summed energy deposition in a
- given strip, while the second member of the values is the number of
- hits in a given strip. Using the second member, it's possible to
- do some checks on just how many times a strip got hit, and what
- kind of error we get in our reconstructed hits. Note, that this
- information is currently not written to the digits tree. I think a
- QA (Quality Assurance) digit tree is better suited for that task.
- However, the information is there to be used in the future.
- @ingroup FMD_sim
- */
-class AliFMDBaseDigitizer : public AliDigitizer
-{
-public:
- /** CTOR */
- AliFMDBaseDigitizer();
- /** Normal CTOR
- @param manager Manager of digitization */
- AliFMDBaseDigitizer(AliRunDigitizer * manager);
- /** Normal ctor
- @param name Name
- @param title Title */
- AliFMDBaseDigitizer(const Char_t* name, const Char_t* title);
- /** DTOR */
- virtual ~AliFMDBaseDigitizer();
-
- /** Initialize */
- virtual Bool_t Init();
-
- /** The response shape of the VA1 shaping circuit is approximently
- given by
- @f[
- f(x) = A(1 - \exp(-Bx))
- @f]
- where @f$ A@f$ is the total charge collected by the pre-amp.,
- and @f$ B@f$ is parameter that depends on the shaping time of
- the @b VA1 pre-amp. This member function sets the parameter @f$
- B@f$
- @param B */
- void SetShapingTime(Float_t B=10) { fShapingTime = B; }
- /** @return Get the shaping time */
- Float_t GetShapingTime() const { return fShapingTime; }
-protected:
- /** Sum energy deposited contributions from each hit in a cache
- @param fmd Pointer to detector */
- virtual void SumContributions(AliFMD* fmd);
- /** For the stored energy contributions in the cache, convert the
- energy signal to ADC counts, and store the created digit in
- the digits array
- @param fmd Pointer to detector */
- virtual void DigitizeHits(AliFMD* fmd) const;
- /** Convert the total energy deposited to a (set of) ADC count(s).
- See also the class description for more details.
- @param edep Total energy deposited in detector
- @param last Last charge collected in previous VA1 channnel
- @param detector Detector #
- @param ring Ring ID
- @param sector Sector #
- @param strip Strip #
- @param counts Array holding the counts on return */
- virtual void ConvertToCount(Float_t edep,
- Float_t last,
- UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- TArrayI& counts) const;
- /** Make a pedestal
- @param detector Detector #
- @param ring Ring ID
- @param sector Sector #
- @param strip Strip #
- @return Pedestal value */
- virtual UShort_t MakePedestal(UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip) const;
- /** Add noise to each sample */
- virtual void AddNoise(TArrayI&) const {}
- /** Add a digit to output */
- virtual void AddDigit(AliFMD* /* fmd */,
- UShort_t /* detector */,
- Char_t /* ring */,
- UShort_t /* sector */,
- UShort_t /* strip */,
- Float_t /* edep */,
- UShort_t /* count1 */,
- Short_t /* count2 */,
- Short_t /* count3 */) const {}
-
- AliRunLoader* fRunLoader; //! Run loader
- AliFMDEdepMap fEdep; // Cache of Energy from hits
- Float_t fShapingTime; // Shaping profile parameter
-
- /** Copy CTOR
- @param o object to copy from */
- AliFMDBaseDigitizer(const AliFMDBaseDigitizer& o)
- : AliDigitizer(o) {}
- /** Assignment operator
- @return Reference to this object */
- AliFMDBaseDigitizer& operator=(const AliFMDBaseDigitizer&) { return *this; }
- ClassDef(AliFMDBaseDigitizer,2) // Base class for FMD digitizers
-};
//====================================================================
/** @class AliFMDDigitizer
ClassDef(AliFMDDigitizer,1) // Make Digits from Hits
};
-//====================================================================
-/** @class AliFMDSDigitizer AliFMDDigitizer.h <FMD/AliFMDDigitizer.h>
- @brief Concrete implementation to make summable digits.
- See also class documentation of AliFMDBaseDigitizer
- @ingroup FMD_sim
- */
-class AliFMDSDigitizer : public AliFMDBaseDigitizer
-{
-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="");
- /** DTOR */
- virtual ~AliFMDSDigitizer();
- /** Do it all
- @param option Not used */
- virtual void Exec(Option_t* option=0);
-protected:
- /** Add a digit to output.
- @param fmd Pointer to detector object
- @param detector Detector #
- @param ring Ring ID
- @param sector Sector number
- @param strip Strip number
- @param edep Energy deposited (not used)
- @param count1 ADC count 1
- @param count2 ADC count 2 (-1 if not used)
- @param count3 ADC count 3 (-1 if not used) */
- virtual void AddDigit(AliFMD* fmd,
- UShort_t detector,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- Float_t edep,
- UShort_t count1,
- Short_t count2,
- Short_t count3) const;
- ClassDef(AliFMDSDigitizer,0) // Make Summable Digits from Hits
-};
-
-
#endif
//____________________________________________________________________
#include "AliFMDRecPoint.h" // ALIFMDRECPOINT_H
#include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
-#include <AliESDFMD.h> // ALIESDFMD_H
+// #include <AliESDFMD.h> // ALIESDFMD_H
#include <AliLog.h>
#include <TStyle.h>
-#include <TArrayF.h>
+// #include <TArrayF.h>
#include <TMarker3DBox.h>
#include <TGeoManager.h>
-#include <TMath.h>
+// #include <TMath.h>
#include <TApplication.h>
#include <TButton.h>
-#include <TParticle.h>
+// #include <TParticle.h>
#include <TCanvas.h>
#include <TView.h>
#include <TVirtualX.h>
AliFMDDisplay*
AliFMDDisplay::Instance()
{
+ // Return static instance
return fgInstance;
}
Bool_t
AliFMDDisplay::Init()
{
+ // Initialize. GEt transforms and such,
if (!AliFMDInput::Init()) return kFALSE;
AliFMDGeometry* geom = AliFMDGeometry::Instance();
geom->Init();
Bool_t
AliFMDDisplay::Begin(Int_t event)
{
+ // Begin of event. Make canvas is not already done
if (!fCanvas) {
gStyle->SetPalette(1);
fCanvas = new TCanvas("display", "Display", 700, 700);
Bool_t
AliFMDDisplay::End()
{
+ // End of event. Draw everything
fPad->cd();
fMarkers->Draw();
fPad->cd();
Int_t
AliFMDDisplay::LookupColor(Float_t x, Float_t max) const
{
+ // Look-up color
Int_t idx = Int_t(x / max * gStyle->GetNumberOfColors());
return gStyle->GetColorPalette(idx);
}
Bool_t
AliFMDDisplay::ProcessHit(AliFMDHit* hit, TParticle* p)
{
+ // Process a hit
if (!hit) { AliError("No hit"); return kFALSE; }
if (!p) { AliError("No track"); return kFALSE; }
Bool_t
AliFMDDisplay::ProcessDigit(AliFMDDigit* digit)
{
+ // Process a digit
if (!digit) { AliError("No digit"); return kFALSE; }
Double_t x, y, z;
Bool_t
AliFMDDisplay::ProcessRaw(AliFMDDigit* digit)
{
+ // PRocess raw data
return ProcessDigit(digit);
}
Bool_t
AliFMDDisplay::ProcessRecPoint(AliFMDRecPoint* recpoint)
{
+ // Process reconstructed point
if (!recpoint) { AliError("No recpoint"); return kFALSE; }
if (recpoint->Particles() < .1) return kTRUE;
fHits->Add(recpoint);
@return @c false on error */
virtual Int_t LookupColor(Float_t x, Float_t max) const;
protected:
+ AliFMDDisplay(const AliFMDDisplay& o) : AliFMDInput(o) { }
+ AliFMDDisplay& operator=(const AliFMDDisplay&) { return *this; }
+
static AliFMDDisplay* fgInstance; // Static instance
Bool_t fWait; // Wait until user presses `Continue'
TObjArray* fMarkers; // Cache of markers
--- /dev/null
+#ifndef ALIFMDEDEPHITPAIR_H
+#define ALIFMDEDEPHITPAIR_H
+/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
+ * reserved.
+ *
+ * See cxx source for full Copyright notice
+ */
+/** @file AliFMDEdepHitPair.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:39:50 2006
+ @brief Per strip map of energy deposited and number of hits
+ @ingroup FMD_sim
+*/
+//____________________________________________________________________
+//
+// Contains a pair of energy deposited fEdep and number of hits
+// fN, fEdep is the summed energy deposition, and fN is the
+// number of hits. The map contains one such object or each strip.
+// It is used to cache the data in the digitization classes
+// AliFMDBaseDigitizer and so on.
+//
+#ifndef ROOT_Rtypes
+# include <Rtypes.h>
+#endif
+//____________________________________________________________________
+/** @brief Cache of Energy deposited, hit information per strip.
+ Contains a pair of energy deposited @c fEdep and
+ number of hits @c fN, @c fEdep is the summed energy deposition,
+ and @c fN is the number of hits
+ @ingroup FMD_sim
+*/
+class AliFMDEdepHitPair
+{
+public:
+ Float_t fEdep; // summed energy deposition
+ UShort_t fN; // Number of hits
+ /** CTOR */
+ AliFMDEdepHitPair() : fEdep(0), fN(0) {}
+ /** DTOR */
+ virtual ~AliFMDEdepHitPair() {}
+ /** Assignment operator
+ @param o Object to assign from
+ @return Reference to this object */
+ AliFMDEdepHitPair& operator=(const AliFMDEdepHitPair& o)
+ { fEdep = o.fEdep; fN = o.fN; return *this; }
+ /** Copy CTOR
+ @param o Object to copy from */
+ AliFMDEdepHitPair(const AliFMDEdepHitPair& o) : fEdep(o.fEdep), fN(o.fN) {}
+ ClassDef(AliFMDEdepHitPair, 1)
+};
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+// mode: C++
+// End:
+//
+// EOF
+//
+
+
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:39:50 2006
@brief Per strip map of energy deposited and number of hits
+ @ingroup FMD_sim
*/
//____________________________________________________________________
//
+// Contains a pair of energy deposited fEdep and number of hits
+// fN, fEdep is the summed energy deposition, and fN is the
+// number of hits. The map contains one such object or each strip.
+// It is used to cache the data in the digitization classes
+// AliFMDBaseDigitizer and so on.
//
//
#include "AliFMDEdepMap.h" // ALIFMDEDEPMAP_H
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:39:50 2006
@brief Per strip map of energy deposited and number of hits
+ @ingroup FMD_sim
*/
+//
+// Contains a pair of energy deposited @c fEdep and number of hits @c
+// fN, @c fEdep is the summed energy deposition, and @c fN is the
+// number of hits
#ifndef ALIFMDMAP_H
# include "AliFMDMap.h"
#endif
+#ifndef ALIFMDEDEPHITPAIR_H
+# include <AliFMDEdepHitPair.h>
+#endif
+
+
//____________________________________________________________________
-/** @brief Cache of Energy deposited, hit information per strip.
+/** @brief Map of Energy deposited, hit information per strip.
Contains a pair of energy deposited @c fEdep and
number of hits @c fN, @c fEdep is the summed energy deposition,
and @c fN is the number of hits
@ingroup FMD_sim
*/
-class AliFMDEdepHitPair
-{
-public:
- Float_t fEdep; // summed energy deposition
- UShort_t fN; // Number of hits
- /** CTOR */
- AliFMDEdepHitPair() : fEdep(0), fN(0) {}
- /** DTOR */
- virtual ~AliFMDEdepHitPair() {}
- /** Assignment operator
- @param o Object to assign from
- @return Reference to this object */
- AliFMDEdepHitPair& operator=(const AliFMDEdepHitPair& o)
- { fEdep = o.fEdep; fN = o.fN; return *this; }
- /** Copy CTOR
- @param o Object to copy from */
- AliFMDEdepHitPair(const AliFMDEdepHitPair& o) : fEdep(o.fEdep), fN(o.fN) {}
- ClassDef(AliFMDEdepHitPair, 1)
-};
-
-//____________________________________________________________________
-/** @brief Map of Energy deposited, hit information per strip.
- Contains a pair of energy deposited @c fEdep and
- number of hits @c fN, @c fEdep is the summed energy deposition,
- and @c fN is the number of hits */
class AliFMDEdepMap : public AliFMDMap
{
public:
#include "AliRecPoint.h" // ALIRECPOINT_H
#include "AliLog.h" // ALIRECPOINT_H
#include <TVector3.h> // ROOT_TVector3
-#include <TMatrix.h> // ROOT_TMatrix
-#include <TParticle.h> // ROOT_TParticle
+// #include <TMatrix.h> // ROOT_TMatrix
+// #include <TParticle.h> // ROOT_TParticle
#include <Riostream.h>
#include "AliFMDGeometryBuilder.h"
-#include <TArrayI.h>
+// #include <TArrayI.h>
#include <TGeoManager.h>
#include <TGeoVolume.h>
#include <TGeoNode.h>
void
AliFMDGeometry::InitTransformations()
{
+ // Find all local <-> global transforms
if (!gGeoManager) {
AliError("No TGeoManager defined");
return;
void
AliFMDGeometry::Build()
{
+ // Build the geometry
if (!fBuilder) fBuilder = new AliFMDGeometryBuilder(fDetailed);
fBuilder->SetDetailed(fDetailed);
fBuilder->UseAssembly(fUseAssembly);
void
AliFMDGeometry::SetActive(Int_t* active, Int_t n)
{
+ // Set active volumes
fActive.Set(n);
for (Int_t i = 0; i < n; i++) {
AliDebug(1, Form("Active vol id # %d: %d", i, active[i]));
void
AliFMDGeometry::AddActive(Int_t active)
{
+ // Add an active volume
Int_t n = fActive.fN;
fActive.Set(n+1);
fActive[n] = active;
Bool_t
AliFMDGeometry::IsActive(Int_t vol) const
{
+ // Check if a volume is active
for (Int_t i = 0; i < fActive.fN; i++)
if (fActive[i] == vol) return kTRUE;
return kFALSE;
Int_t
FindNodeDepth(const char* name, const char* volname)
{
+ // Find the depth of a node
TGeoVolume* vol = gGeoManager->GetVolume(volname);
if (!vol) {
std::cerr << "No top volume defined" << std::endl;
@date Mon Mar 27 12:40:37 2006
@brief Geometry mananger for the FMD
*/
-//____________________________________________________________________
-//
+//____________________________________________________________________
+//
// Forward Multiplicity Detector based on Silicon wafers.
//
// This class is a singleton that handles the geometry parameters of
AliFMDGeometry& operator=(const AliFMDGeometry& other);
virtual ~AliFMDGeometry() {}
- AliFMDGeometryBuilder* fBuilder;
- Int_t fDetectorOff;
- Int_t fModuleOff;
- Int_t fRingOff;
- Int_t fSectorOff;
- TArrayI fActive;
- Bool_t fDetailed;
- Bool_t fUseAssembly;
+ AliFMDGeometryBuilder* fBuilder; // Geometry builder
+ Int_t fDetectorOff; // Detector off-set
+ Int_t fModuleOff; // Module off-set
+ Int_t fRingOff; // ring offset
+ Int_t fSectorOff; // Sector offset
+ TArrayI fActive; // Active volumes
+ Bool_t fDetailed; // Whether to make detailed geom
+ Bool_t fUseAssembly; // Whther to use assemblies
- ClassDef(AliFMDGeometry,1); //
+ ClassDef(AliFMDGeometry,1); // Geometry parameters and manager
};
*/
//____________________________________________________________________
//
+// Builder of FMD geometry.
+// This class takes care of actually building the geometry using the
+// TGeo classes. Various parameters are fecthed from the
+// AliFMDGeometry manager.
+//
// Forward Multiplicity Detector based on Silicon wafers. This class
// contains the base procedures for the Forward Multiplicity detector
// Detector consists of 3 sub-detectors FMD1, FMD2, and FMD3, each of
#include "AliLog.h" // ALILOG_H
#include <TGeoVolume.h> // ROOT_TGeoVolume
#include <TGeoTube.h> // ROOT_TGeoTube
-#include <TGeoPcon.h> // ROOT_TGeoPcon
-#include <TGeoMaterial.h> // ROOT_TGeoMaterial
-#include <TGeoMedium.h> // ROOT_TGeoMedium
+//#include <TGeoPcon.h> // ROOT_TGeoPcon
+//#include <TGeoMaterial.h> // ROOT_TGeoMaterial
+//#include <TGeoMedium.h> // ROOT_TGeoMedium
#include <TGeoXtru.h> // ROOT_TGeoXtru
-#include <TGeoPolygon.h> // ROOT_TGeoPolygon
+//#include <TGeoPolygon.h> // ROOT_TGeoPolygon
#include <TGeoTube.h> // ROOT_TGeoTube
#include <TGeoManager.h> // ROOT_TGeoManager
#include <TVector2.h> // ROOT_TVector2
}
Char_t id = r->GetId();
Double_t siThick = r->GetSiThickness();
- const Int_t nv = r->GetNVerticies();
+ const Int_t knv = r->GetNVerticies();
TVector2* a = r->GetVertex(5);
TVector2* b = r->GetVertex(3);
TVector2* c = r->GetVertex(4);
Double_t stripoff = a->Mod();
Double_t dstrip = (rmax - stripoff) / ns;
Double_t space = r->GetSpacing();
- TArrayD xs(nv);
- TArrayD ys(nv);
- for (Int_t i = 0; i < nv; i++) {
+ TArrayD xs(knv);
+ TArrayD ys(knv);
+ for (Int_t i = 0; i < knv; i++) {
// Reverse the order
- TVector2* vv = r->GetVertex(nv - 1 - i);
+ TVector2* vv = r->GetVertex(knv - 1 - i);
if (!vv) {
- AliError(Form("Failed to get vertex # %d", nv - 1 - i));
+ AliError(Form("Failed to get vertex # %d", knv - 1 - i));
continue;
}
xs[i] = vv->X();
// Shape of actual sensor
TGeoXtru* sensorShape = new TGeoXtru(2);
- sensorShape->DefinePolygon(nv, xs.fArray, ys.fArray);
+ sensorShape->DefinePolygon(knv, xs.fArray, ys.fArray);
sensorShape->DefineSection(0, - siThick/2);
sensorShape->DefineSection(1, siThick/2);
TGeoVolume* sensorVolume = new TGeoVolume(Form(fgkSensorName, id),
}
// Shape of Printed circuit Board
- for (Int_t i = 0; i < nv / 2; i++) ys[i] -= off;
- for (Int_t i = nv / 2; i < nv; i++) ys[i] += off;
+ for (Int_t i = 0; i < knv / 2; i++) ys[i] -= off;
+ for (Int_t i = knv / 2; i < knv; i++) ys[i] += off;
TGeoXtru* pcbShape = new TGeoXtru(2);
- pcbShape->DefinePolygon(nv, xs.fArray, ys.fArray);
+ pcbShape->DefinePolygon(knv, xs.fArray, ys.fArray);
pcbShape->DefineSection(0, - pcbThick/2);
pcbShape->DefineSection(1, pcbThick/2);
TGeoVolume* pcbVolume = new TGeoVolume(Form(fgkPCBName, id),
*
* See cxx source for full Copyright notice
*/
+// Builder of FMD geometry.
+// This class takes care of actually building the geometry using the
+// TGeo classes. Various parameters are fecthed from the
+// AliFMDGeometry manager.
/** @file AliFMDGeometryBuilder.h
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:41:17 2006
/** @return Detector offfset in the volume tree */
Int_t GetDetectorOff() const { return fDetectorOff; }
protected:
+ /** Copy CTOR */
+ AliFMDGeometryBuilder(const AliFMDGeometryBuilder& o) : TTask(o) {}
+ /** Assignment operator */
+ AliFMDGeometryBuilder& operator=(const AliFMDGeometryBuilder&){return *this;}
/** Make a ring volume
@param r Ring geometry
@return Ring volume */
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:41:58 2006
@brief Hit in the FMD
+ @ingroup FMD_sim
*/
//____________________________________________________________________
//
// Latest changes by Christian Holm Christensen
//
#include "AliFMDHit.h" // ALIFMDHIT_H
-#include "AliLog.h" // ALILOG_H
+// #include "AliLog.h" // ALILOG_H
#include "Riostream.h" // ROOT_Riostream
#include <TDatabasePDG.h>
-#include <TMath.h>
+// #include <TMath.h>
#include <TString.h>
//____________________________________________________________________
const char*
AliFMDHit::GetName() const
{
+ // Get the name
static TString n;
n = Form("FMD%d%c[%2d,%3d]", fDetector,fRing,fSector,fStrip);
return n.Data();
const char*
AliFMDHit::GetTitle() const
{
+ // Get the title
static TString t;
TDatabasePDG* pdgDB = TDatabasePDG::Instance();
TParticlePDG* pdg = pdgDB->GetParticle(fPdg);
*
* See cxx source for full Copyright notice
*/
+// Hits are the information that comes from a Monte Carlo at each
+// step as a particle mass through sensitive detector elements as
+// particles are transported through a detector.
/** @file AliFMDHit.h
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:41:58 2006
@brief Hit in the FMD
+ @ingroup FMD_sim
*/
//___________________________________________________________________
//
fSector(0),
fStrip(0),
fHash(-1)
-{}
+{
+ // CTOR
+}
//____________________________________________________________________
AliFMDIndex::AliFMDIndex(const AliFMDIndex& o)
Int_t
AliFMDIndex::Hash() const
{
+ // calculate hash value
if (fHash < 0) {
size_t ringi = (fRing == 'I' || fRing == 'i' ? 0 : 1);
fHash = (fStrip +
const char*
AliFMDIndex::Name() const
{
+ // GEt the name of the index
if (fName.IsNull())
fName = Form("FMD%d%c[%2d,%3d]", fDetector, fRing, fSector, fStrip);
return fName.Data();
Int_t
AliFMDObjIndex::Compare(const TObject* o) const
{
+ // Compare to another index
const AliFMDObjIndex* a = dynamic_cast<const AliFMDObjIndex*>(o);
if (!a) {
Fatal("Compare",
#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>
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 retval;
}
-//====================================================================
-ClassImp(AliFMDInputHits)
-#if 0
- ;
-#endif
-
-
-//====================================================================
-ClassImp(AliFMDInputDigits)
-#if 0
- ;
-#endif
-
-//====================================================================
-ClassImp(AliFMDInputSDigits)
-#if 0
- ;
-#endif
-
-//====================================================================
-ClassImp(AliFMDInputRecPoints)
-#if 0
- ;
-#endif
//____________________________________________________________________
//
*
* See cxx source for full Copyright notice
*/
+//___________________________________________________________________
+//
+// The classes defined here, are utility classes for reading in data
+// for the FMD. They are put in a seperate library to not polute the
+// normal libraries. The classes are intended to be used as base
+// classes for customized class that do some sort of analysis on the
+// various types of data produced by the FMD.
/** @file AliFMDInput.h
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:42:40 2006
virtual Bool_t ProcessESD(AliESDFMD*) { return kTRUE; }
protected:
+ /** Copy ctor
+ @param o Object to copy from */
+ AliFMDInput(const AliFMDInput& o) : TObject(o) {}
+ /** Assignement operator
+ @return REference to this */
+ AliFMDInput& operator=(const AliFMDInput&) { return *this; }
+
TString fGAliceFile; // File name of gAlice file
AliRunLoader* fLoader; // Loader of FMD data
AliRun* fRun; // Run information
TClonesArray* fArrayA; // Raw data (digits) info array
TGeoManager* fGeoManager; // Geometry manager
Int_t fTreeMask; // Which tree's to load
- Bool_t fIsInit;
+ Bool_t fIsInit; // Have we been initialized
ClassDef(AliFMDInput,0) //Hits for detector FMD
};
-//____________________________________________________________________
-class AliFMDHit;
-/** @brief Class to read FMD hits
- */
-class AliFMDInputHits : public AliFMDInput
-{
-public:
- /** Constructor
- @param file Name of @c gAlice file */
- AliFMDInputHits(const char* file="galice.root")
- : AliFMDInput(file) { AddLoad(kHits); }
- ClassDef(AliFMDInputHits, 0);
-};
-
-//____________________________________________________________________
-class AliFMDDigit;
-/** @brief Class to read FMD digits
- */
-class AliFMDInputDigits : public AliFMDInput
-{
-public:
- /** Constructor
- @param file Name of @c gAlice file */
- AliFMDInputDigits(const char* file="galice.root")
- : AliFMDInput(file) { AddLoad(kDigits); }
- ClassDef(AliFMDInputDigits, 0);
-};
-
-//____________________________________________________________________
-class AliFMDSDigit;
-/** @brief Class to read FMD summable digits
- */
-class AliFMDInputSDigits : public AliFMDInput
-{
-public:
- /** Constructor
- @param file Name of @c gAlice file */
- AliFMDInputSDigits(const char* file="galice.root")
- : AliFMDInput(file) { AddLoad(kSDigits); }
- ClassDef(AliFMDInputSDigits, 0);
-};
-
-//____________________________________________________________________
-/** @brief Class to read FMD raw data
- */
-class AliFMDInputRaw : public AliFMDInput
-{
-public:
- /** Constructor
- @param file Name of @c gAlice file */
- AliFMDInputRaw(const char* file="galice.root")
- : AliFMDInput(file) { AddLoad(kRaw); }
- ClassDef(AliFMDInputRaw, 0);
-};
-
-//____________________________________________________________________
-class AliFMDRecPoint;
-/** @brief Class to read FMD reconstructed data
- */
-class AliFMDInputRecPoints : public AliFMDInput
-{
-public:
- /** Constructor
- @param file Name of @c gAlice file */
- AliFMDInputRecPoints(const char* file="galice.root")
- : AliFMDInput(file) { AddLoad(kRecPoints); }
- ClassDef(AliFMDInputRecPoints, 0);
-};
-
#endif
//____________________________________________________________________
//
//____________________________________________________________________
AliFMDParameters::AliFMDParameters()
: fIsInit(kFALSE),
- fSiDeDxMip(1.664),
+ fkSiDeDxMip(1.664),
fFixedPulseGain(0),
fEdepMip(0),
fZeroSuppression(0),
void
AliFMDParameters::Print(Option_t* option) const
{
+ // Print information.
+ // If option contains an 'A' then everything is printed.
TString opt(option);
Bool_t showStrips = opt.Contains("a", TString::kIgnoreCase);
for (UShort_t det=1 ; det <= 3; det++) {
void
AliFMDParameters::SetStripRange(UShort_t min, UShort_t max)
{
+ // Set fixed strip range
fFixedMinStrip = min;
fFixedMaxStrip = max;
}
void
AliFMDParameters::InitPulseGain()
{
+ // Get pulse gain from CDB or used fixed
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBEntry* gain = cdb->Get(fgkPulseGain);
if (!gain) {
void
AliFMDParameters::InitPedestal()
{
+ // Initialize the pedestals from CDB
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBEntry* pedestal = cdb->Get(fgkPedestal);
if (!pedestal) {
void
AliFMDParameters::InitDeadMap()
{
+ // Get Dead-channel-map from CDB
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBEntry* deadMap = cdb->Get(fgkDead);
if (!deadMap) {
void
AliFMDParameters::InitZeroSuppression()
{
+ // Get 0-suppression from CDB
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBEntry* zeroSup = cdb->Get(fgkZeroSuppression);
if (!zeroSup) {
void
AliFMDParameters::InitSampleRate()
{
+ // get Sample rate from CDB
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBEntry* sampRat = cdb->Get(fgkSampleRate);
if (!sampRat) {
void
AliFMDParameters::InitAltroMap()
{
+ // Get hardware mapping from CDB
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBEntry* hwMap = cdb->Get(fgkAltroMap);
if (!hwMap) {
void
AliFMDParameters::InitStripRange()
{
+ // Get strips read-out from CDB
AliCDBManager* cdb = AliCDBManager::Instance();
AliCDBEntry* range = cdb->Get(fgkStripRange);
if (!range) {
Float_t
AliFMDParameters::GetThreshold() const
{
+ // Get threshold from CDB
if (!fPulseGain) return fFixedThreshold;
return fPulseGain->Threshold();
}
AliFMDParameters::IsDead(UShort_t detector, Char_t ring,
UShort_t sector, UShort_t strip) const
{
+ // Check if the channel is dead
if (!fDeadMap) return kFALSE;
AliDebug(50, Form("Dead for FMD%d%c[%2d,%3d]=%s",
detector, ring, sector, strip,
AliFMDParameters::GetZeroSuppression(UShort_t detector, Char_t ring,
UShort_t sector, UShort_t strip) const
{
+ // Get zero suppression threshold
if (!fZeroSuppression) return fFixedZeroSuppression;
// Need to map strip to ALTRO chip.
AliDebug(50, Form("zero sup. for FMD%d%c[%2d,%3d]=%f",
AliFMDParameters::GetSampleRate(UShort_t det, Char_t ring, UShort_t sector,
UShort_t str) const
{
+ // Get sampl rate
if (!fSampleRate) return fFixedSampleRate;
// Need to map sector to digitizier card.
UInt_t ret = fSampleRate->Rate(det, ring, sector, str);
AliFMDParameters::GetMinStrip(UShort_t det, Char_t ring, UShort_t sector,
UShort_t str) const
{
+ // Get strip range read out
if (!fStripRange) return fFixedMinStrip;
// Need to map sector to digitizier card.
UInt_t ret = fStripRange->Min(det, ring, sector, str);
AliFMDParameters::GetMaxStrip(UShort_t det, Char_t ring, UShort_t sector,
UShort_t str) const
{
+ // Get strip range read out
if (!fStripRange) return fFixedMaxStrip;
// Need to map sector to digitizier card.
UInt_t ret = fStripRange->Max(det, ring, sector, str);
AliFMDParameters::GetPedestal(UShort_t detector, Char_t ring,
UShort_t sector, UShort_t strip) const
{
+ // Get the pedesal
if (!fPedestal) return fFixedPedestal;
AliDebug(50, Form("pedestal for FMD%d%c[%2d,%3d]=%f",
detector, ring, sector, strip,
AliFMDParameters::GetPedestalWidth(UShort_t detector, Char_t ring,
UShort_t sector, UShort_t strip) const
{
+ // Get the pedesal
if (!fPedestal) return fFixedPedestalWidth;
AliDebug(50, Form("pedetal width for FMD%d%c[%2d,%3d]=%f",
detector, ring, sector, strip,
AliFMDAltroMapping*
AliFMDParameters::GetAltroMap() const
{
+ // Get the hardware address to detector index map
return fAltroMap;
}
Char_t& ring, UShort_t& sec,
UShort_t& str) const
{
+ // Map hardware address to detector index
if (!fAltroMap) return kFALSE;
return fAltroMap->Hardware2Detector(ddl, addr, det, ring, sec, str);
}
UShort_t str, UInt_t& ddl,
UInt_t& addr) const
{
+ // Map detector index to hardware address
if (!fAltroMap) return kFALSE;
return fAltroMap->Detector2Hardware(det, ring, sec, str, ddl, addr);
}
// Get energy deposited by a MIP in the silicon sensors
if (fEdepMip <= 0){
AliFMDGeometry* fmd = AliFMDGeometry::Instance();
- fEdepMip = (fSiDeDxMip
+ fEdepMip = (fkSiDeDxMip
* fmd->GetRing('I')->GetSiThickness()
* fmd->GetSiDensity());
}
*
* See cxx source for full Copyright notice
*/
-/** @file AliFMDParameters.h
- @author Christian Holm Christensen <cholm@nbi.dk>
- @date Mon Mar 27 12:44:43 2006
- @brief Manager of FMD parameters
-*/
//____________________________________________________________________
//
// Singleton class to handle various parameters (not geometry) of the
// FMD
// Should get ata fromm Conditions DB.
//
+/** @file AliFMDParameters.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:44:43 2006
+ @brief Manager of FMD parameters
+*/
#ifndef ROOT_TNamed
# include <TNamed.h>
#endif
class AliFMDCalibSampleRate;
class AliFMDCalibStripRange;
class AliFMDAltroMapping;
+//____________________________________________________________________
+//
+// Singleton class to handle various parameters (not geometry) of the
+// FMD
+// Should get ata fromm Conditions DB.
+//
/** @brief This class is a singleton that handles various parameters
of the FMD detectors.
enum {
kBaseDDL = 0x1000 // DDL offset for the FMD
};
- static const char* fgkPulseGain; // Path to PulseGain calib object
- static const char* fgkPedestal; // Path to Pedestal calib object
- static const char* fgkDead; // Path to Dead calib object
- static const char* fgkSampleRate; // Path to SampleRate calib object
- static const char* fgkAltroMap; // Path to AltroMap calib object
- static const char* fgkZeroSuppression; // Path to ZeroSuppression cal object
- static const char* fgkStripRange; // Path to strip range cal object
+ static const char* PulseGainPath() { return fgkPulseGain; }
+ static const char* PedestalPath() { return fgkPedestal; }
+ static const char* DeadPath() { return fgkDead; }
+ static const char* SampleRatePath() { return fgkSampleRate; }
+ static const char* AltroMapPath() { return fgkAltroMap; }
+ static const char* ZeroSuppressionPath() { return fgkZeroSuppression; }
+ static const char* StripRangePath() { return fgkStripRange; }
protected:
/** CTOR */
AliFMDParameters();
+ /** CTOR */
+ AliFMDParameters(const AliFMDParameters& o)
+ : TNamed(o), fkSiDeDxMip(o.fkSiDeDxMip) {}
+ /** Assignement operator
+ @return Reference to this */
+ AliFMDParameters& operator=(const AliFMDParameters&) { return *this; }
/** DTOR */
virtual ~AliFMDParameters() {}
/** Singleton instance */
Bool_t fIsInit; // Whether we've been initialised
- const Float_t fSiDeDxMip; // MIP dE/dx in Silicon
+ static const char* fgkPulseGain; // Path to PulseGain calib object
+ static const char* fgkPedestal; // Path to Pedestal calib object
+ static const char* fgkDead; // Path to Dead calib object
+ static const char* fgkSampleRate; // Path to SampleRate calib object
+ static const char* fgkAltroMap; // Path to AltroMap calib object
+ static const char* fgkZeroSuppression; // Path to ZeroSuppression cal object
+ static const char* fgkStripRange; // Path to strip range cal object
+ const Float_t fkSiDeDxMip; // MIP dE/dx in Silicon
UShort_t fVA1MipRange; // # MIPs the pre-amp can do
UShort_t fAltroChannelSize; // Largest # to store in 1 ADC ch.
UShort_t fChannelsPerAltro; // Number of pre-amp. chan/adc chan.
Float_t fFixedPedestalWidth; // Width of pedestal
UShort_t fFixedZeroSuppression; // Threshold for zero-suppression
UShort_t fFixedSampleRate; // Times the ALTRO samples pre-amp.
- Float_t fFixedThreshold; //
- UShort_t fFixedMinStrip;
- UShort_t fFixedMaxStrip;
+ Float_t fFixedThreshold; // Threshold in ADC counts
+ UShort_t fFixedMinStrip; // Minimum strip read-out
+ UShort_t fFixedMaxStrip; // Maximum strip read-out
mutable Float_t fFixedPulseGain; //! Gain (cached)
mutable Float_t fEdepMip; //! Cache of energy loss for a MIP
AliFMDAltroMapping* fAltroMap; // Map of hardware
AliFMDCalibStripRange* fStripRange; // Strip range
- ClassDef(AliFMDParameters,4)
+ ClassDef(AliFMDParameters,5) // Manager of parameters
};
#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$ */
+/** @file AliFMDPoints.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Tue Apr 11 12:42:50 2006
+ @brief Specialised class for drawing hits in the FMD.
+ @ingroup FMD_sim
+*/
+// Specialised class for drawing hits in the FMD. The normal
+// AliPoints class isn't really suited for the FMD, as it connects the
+// dots between hits from the same particle. However, in the FMD, all
+// hits are not identified by a track, so this has little meaning.
+// What is more interresting, is the actual size of the hit.
+#include <TMath.h> // ROOT_TMath
+#include <TVector3.h> // ROOT_TVector3
+#include <TMarker3DBox.h> // ROOT_TMarker3DBox
+#include "AliFMDHit.h" // ALIFMDHIT_H
+#include "AliFMDPoints.h" // ALIFMDPOINTS_H
+
+//____________________________________________________________________
+AliFMDPoints::AliFMDPoints(AliFMDHit* hit, UInt_t color)
+ : AliPoints(1), fMarker(0)
+{
+ // Constructor
+ // Params:
+ // hit Hit to represent
+ // color Color of marker
+ //
+ if (!hit) return;
+ Float_t size = TMath::Min(TMath::Max(hit->Edep() * .1, .1), 1.);
+ TVector3 p(hit->Px(), hit->Py(), hit->Pz());
+ fMarker = new TMarker3DBox(hit->X(), hit->Y(), hit->Z(), size, size, size,
+ p.Theta(), p.Phi());
+ fMarker->SetLineColor(color);
+ fMarker->SetRefObject(this);
+ fP[0] = hit->X();
+ fP[1] = hit->Y();
+ fP[2] = hit->Z();
+}
+
+//____________________________________________________________________
+AliFMDPoints::AliFMDPoints(const AliFMDPoints& other)
+ : AliPoints(other), fMarker(other.fMarker)
+{
+ // Copy constructor
+}
+
+//____________________________________________________________________
+AliFMDPoints&
+AliFMDPoints::operator=(const AliFMDPoints& other)
+{
+ // Assignment operator
+ fMarker = other.fMarker;
+ return *this;
+}
+
+
+//____________________________________________________________________
+AliFMDPoints::~AliFMDPoints()
+{
+ // Destructor
+ // if (fMarker) delete fMarker;
+}
+//____________________________________________________________________
+void
+AliFMDPoints::SetXYZ(Double_t x, Double_t y, Double_t z)
+{
+ // Set (x,y,z) position of marker
+ // Params
+ // X X position
+ // Y Y position
+ // Z Z position
+ if (fMarker) fMarker->SetPosition(x, y, z);
+}
+
+//____________________________________________________________________
+Int_t
+AliFMDPoints::DistancetoPrimitive(Int_t px, Int_t py)
+{
+ // Calculate distance from (px,py) to this
+ // Params:
+ // Px X-coordinate of marker
+ // Py Y-coordinate of marker
+ // Return
+ // Distance to this
+ return fMarker->DistancetoPrimitive(px, py);
+}
+//____________________________________________________________________
+void
+AliFMDPoints::Draw(Option_t* option)
+{
+ // Draw on pad
+ // Params
+ // option See TMarker3DBox::Draw
+ if (fMarker) fMarker->Draw(option);
+}
+//____________________________________________________________________
+void
+AliFMDPoints::Paint(Option_t* option)
+{
+ // Draw on pad
+ // Params
+ // option See TMarker3DBox::Paint
+ if (fMarker) fMarker->Paint(option);
+}
+
+//____________________________________________________________________
+void
+AliFMDPoints::SetMarkerColor(Color_t colour)
+{
+ // Set the marker color
+ // Params
+ // colour Colour of marker
+ if (fMarker) fMarker->SetLineColor(colour);
+}
+
+//____________________________________________________________________
+//
+// EOF
+//
--- /dev/null
+#ifndef ALIFMDPOINTS_H
+#define ALIFMDPOINTS_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved.
+ *
+ * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
+ *
+ * See cxx source for full Copyright notice
+ */
+/** @file AliFMDPoints.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Tue Apr 11 12:35:31 2006
+ @brief Specialised class for drawing hits in the FMD.
+ @ingroup FMD_sim
+*/
+#ifndef ALIPOINTS_H
+# include <AliPoints.h>
+#endif
+class AliFMHit;
+class TMarker3DBox;
+
+/** @class AliFMDPoints
+ @brief Class to draw hits for the FMD
+ @ingroup FMD_sim
+ */
+class AliFMDPoints : public AliPoints
+{
+public:
+ /** Constructor
+ @param hit Hit to draw
+ @param color Color of hit */
+ AliFMDPoints(AliFMDHit* hit, UInt_t color);
+ /** Copy constructor
+ @param other Objct to copy from */
+ AliFMDPoints(const AliFMDPoints& other);
+ /** Assignment operator
+ @param other Objct to copy from
+ @return reference to this */
+ AliFMDPoints& operator=(const AliFMDPoints& other);
+ /** Destructor */
+ virtual ~AliFMDPoints();
+ /** Set position
+ @param x @f$ x@f$ coordinate
+ @param y @f$ y@f$ coordinate
+ @param z @f$ z@f$ coordinate */
+ void SetXYZ(Double_t x, Double_t y, Double_t z);
+ /** Calculate the distance to this object from cursor
+ @param px Curser X-position
+ @param py Cursor Y-position
+ @return Distance to @f$(p_x,p_y)@f$ */
+ Int_t DistancetoPrimitive(Int_t px, Int_t py);
+ /** Attach to canvas
+ @param option See TMarker3DBox::Draw */
+ void Draw(Option_t* option);
+ /** Paint in canvas
+ @param option See TMarker3DBox::Paint */
+ void Paint(Option_t* option);
+ /** @param colour Colour of marker */
+ void SetMarkerColor(Color_t colour);
+private:
+ /** Marker */
+ TMarker3DBox* fMarker; // Marker
+};
+
+#endif
+// Local Variables:
+// mode: C++
+// End:
+//
+// EOF
+//
@author Christian Holm Christensen <cholm@nbi.dk>
@date Mon Mar 27 12:45:23 2006
@brief Class to read raw data
+ @ingroup FMD_rec
*/
//____________________________________________________________________
//
#include "AliRawReader.h" // ALIRAWREADER_H
#include "AliFMDRawReader.h" // ALIFMDRAWREADER_H
// #include "AliFMDAltroIO.h" // ALIFMDALTROIO_H
-#include <TArrayI.h> // ROOT_TArrayI
+// #include <TArrayI.h> // ROOT_TArrayI
#include <TTree.h> // ROOT_TTree
#include <TClonesArray.h> // ROOT_TClonesArray
-#include <iostream>
-#include <iomanip>
-#include <sstream>
-#define PRETTY_HEX(N,X) \
- " 0x" << std::setfill('0') << std::setw(N) << std::hex << X \
- << std::setfill(' ') << std::dec
+// #include <iostream>
+// #include <iomanip>
//____________________________________________________________________
ClassImp(AliFMDRawReader)
void
AliFMDRawReader::Exec(Option_t*)
{
+ // Read the data
TClonesArray* array = new TClonesArray("AliFMDDigit");
if (!fTree) {
AliError("No tree");
*
* See cxx source for full Copyright notice
*/
-/* $Id$ */
-/** @file AliFMDRawReader.h
- @author Christian Holm Christensen <cholm@nbi.dk>
- @date Mon Mar 27 12:45:23 2006
- @brief Class to read raw data
-*/
//____________________________________________________________________
//
// Class to read ADC values from a AliRawReader object.
// Note, that it uses an ALTRO reader, which is wrong.
// Perhaps we need to implement it our selves
//
+/* $Id$ */
+/** @file AliFMDRawReader.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:45:23 2006
+ @brief Class to read raw data
+ @ingroup FMD_rec
+*/
#ifndef ROOT_TTask
# include <TTask.h>
#endif
@return @c true on success */
virtual Bool_t ReadAdcs(TClonesArray* array);
protected:
+ AliFMDRawReader(const AliFMDRawReader& o) : TTask(o) {}
+ AliFMDRawReader& operator=(const AliFMDRawReader&) { return *this; }
TTree* fTree; //! Pointer to tree to read into
AliRawReader* fReader; //! Pointer to raw reader
UShort_t fSampleRate; // The sample rate (if 0, inferred from data)
// and the sample rate should be set explicitly.
//
#include "AliFMDRawStream.h" // ALIFMDRAWSTREAM_H
-#include <AliRawReader.h> // ALIRAWREADER_H
+// #include <AliRawReader.h> // ALIRAWREADER_H
#include "AliFMDParameters.h"
#include <AliLog.h>
-#include <iomanip>
-#include <iostream>
+// #include <iomanip>
+// #include <iostream>
//____________________________________________________________________
ClassImp(AliFMDRawStream)
AliFMDRawStream::AliFMDRawStream(AliRawReader* reader)
: AliAltroRawStream(reader)
{
+ // CTOR
fNoAltroMapping = kFALSE;
// Select FMD DDL's
SelectRawData(AliFMDParameters::kBaseDDL>>8);
AliFMDRawStream::ReadChannel(UInt_t& ddl, UInt_t& addr,
UInt_t& len, UShort_t* data)
{
+ // Read one channel and return. Returns 0 when there's no more
+ // data.
Int_t l = 0;
static Int_t last = 0xFFFF; // 0xFFFF means signal is used
Bool_t next = kTRUE;
// #include "AliFMDAltroIO.h" // ALIFMDALTROWRITER_H
#include <TArrayI.h> // ROOT_TArrayI
#include <TClonesArray.h> // ROOT_TClonesArray
-#include <fstream>
+// #include <fstream>
//____________________________________________________________________
ClassImp(AliFMDRawWriter)
AliFMDRawWriter::AliFMDRawWriter(AliFMD* fmd)
: TTask("FMDRawWriter", "Writer of Raw ADC values from the FMD"),
fFMD(fmd)
-{}
+{
+ // CTOR
+}
+
//____________________________________________________________________
void
AliFMDRawWriter::WriteDigits(TClonesArray* digits)
{
+ // WRite an array of digits to disk file
Int_t nDigits = digits->GetEntries();
if (nDigits < 1) return;
ALTRO data. */
virtual void WriteDigits(TClonesArray* digits);
protected:
+ AliFMDRawWriter(const AliFMDRawWriter& o) : TTask(o) {}
+ AliFMDRawWriter& operator=(const AliFMDRawWriter&) { return *this; }
AliFMD* fFMD; //! Pointer to detector description
UShort_t fSampleRate; // The sample rate (0 -> inferred from data)
UShort_t fChannelsPerAltro; // Number of pre-amp. channels/adc channel
fEta(0),
fPhi(0),
fEdep(0)
-{}
+{
+ // CTOR
+}
//____________________________________________________________________
AliFMDRecPoint::AliFMDRecPoint(UShort_t detector, Char_t ring,
const char*
AliFMDRecPoint::GetName() const
{
+ // Get the name
static TString n;
n = Form("FMD%d%c[%2d,%3d]", fDetector,fRing,fSector,fStrip);
return n.Data();
const char*
AliFMDRecPoint::GetTitle() const
{
+ // Get the title
static TString t;
t = Form("%f (%f,%f)", fParticles, fEta, fPhi);
return t.Data();
*/
//____________________________________________________________________
//
-// This is a class that constructs AliFMDMult (reconstructed
-// multiplicity) from of Digits
+// This is a class that constructs AliFMDRecPoint objects from of Digits
//
// This class reads either digits from a TClonesArray or raw data from
// a DDL file (or similar), and stores the read ADC counts in an
#include <AliLog.h> // ALILOG_H
#include <AliRun.h> // ALIRUN_H
#include <AliRunLoader.h> // ALIRUNLOADER_H
-#include <AliLoader.h> // ALILOADER_H
#include <AliHeader.h> // ALIHEADER_H
-#include <AliRawReader.h> // ALIRAWREADER_H
#include <AliGenEventHeader.h> // ALIGENEVENTHEADER_H
-#include "AliFMD.h" // ALIFMD_H
#include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
-#include "AliFMDDetector.h" // ALIFMDDETECTOR_H
-#include "AliFMDRing.h" // ALIFMDRING_H
#include "AliFMDDigit.h" // ALIFMDDIGIT_H
#include "AliFMDReconstructor.h" // ALIFMDRECONSTRUCTOR_H
-#include "AliFMDRawStream.h" // ALIFMDRAWSTREAM_H
#include "AliFMDRawReader.h" // ALIFMDRAWREADER_H
#include "AliFMDRecPoint.h" // ALIFMDMULTNAIIVE_H
#include "AliESD.h" // ALIESD_H
#include <AliESDFMD.h> // ALIESDFMD_H
-#include <TFile.h>
+class AliRawReader;
//____________________________________________________________________
ClassImp(AliFMDReconstructor)
/** Not used */
virtual void SetESD(AliESD* esd) { fESD = esd; }
-private:
- /** Hide base classes unused function */
- void Reconstruct(AliRawReader*, TTree*) const;
- /** Hide base classes unused function */
- void Reconstruct(AliRunLoader*) const;
- /** Hide base classes unused function */
- void Reconstruct(AliRunLoader*, AliRawReader*) const;
- /** Hide base classes unused function */
- void FillESD(AliRawReader*, TTree*, AliESD*) const;
- /** Hide base classes unused function */
- void FillESD(AliRunLoader*, AliESD*) const;
- /** Hide base classes unused function */
- void FillESD(AliRunLoader*, AliRawReader*, AliESD*) const;
-
protected:
/** Copy CTOR
@param other Object to copy from. */
mutable TTree* fTreeR; // Output tree
mutable Float_t fCurrentVertex; // Z-coordinate of primary vertex
mutable AliESDFMD* fESDObj; // ESD output object
- AliESD* fESD;
+ AliESD* fESD; // ESD object(?)
+
+private:
+ /** Hide base classes unused function */
+ void Reconstruct(AliRawReader*, TTree*) const;
+ /** Hide base classes unused function */
+ void Reconstruct(AliRunLoader*) const;
+ /** Hide base classes unused function */
+ void Reconstruct(AliRunLoader*, AliRawReader*) const;
+ /** Hide base classes unused function */
+ void FillESD(AliRawReader*, TTree*, AliESD*) const;
+ /** Hide base classes unused function */
+ void FillESD(AliRunLoader*, AliESD*) const;
+ /** Hide base classes unused function */
+ void FillESD(AliRunLoader*, AliRawReader*, AliESD*) const;
ClassDef(AliFMDReconstructor, 0) // class for the FMD reconstruction
};
// Latest changes by Christian Holm Christensen
//
-#include <AliLog.h> // ALILOG_H
+// #include <AliLog.h> // ALILOG_H
#include "AliFMDRing.h" // ALIFMDRING_H
-#include <TMath.h> // ROOT_TMath
+// #include <TMath.h> // ROOT_TMath
#include <TVector2.h> // ROOT_TVector2
//====================================================================
//__________________________________________________________________
//
// Parameters of the FMD rings.
-//
// This class is responsible to make the (common) rings of the three
// sub-detectors.
//
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2004, 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$ */
+/** @file AliFMDSDigit.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:37:41 2006
+ @brief Digits for the FMD
+ @ingroup FMD_base
+*/
+//////////////////////////////////////////////////////////////////////
+//
+// Digits classes for the FMD
+//
+// Digits consists of
+// - Detector #
+// - Ring ID
+// - Sector #
+// - 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
+// AliFMDDigit and AliFMDSDigit are implemented via a base
+// class AliFMDBaseDigit.
+///
+// +-----------------+
+// | AliFMDBaseDigit |
+// +-----------------+
+// ^
+// |
+// +------------+
+// | |
+// +-------------+ +--------------+
+// | AliFMDDigit | | AliFMDSDigit |
+// +-------------+ +--------------+
+//
+// (Note, that I'd really would have liked to implement AliFMDHit as a
+// derived class from some base class - say AliFMDStrip, and the Digit
+// classes would (eventually) have derived from that as well.
+// However, ROOT doesn't do well with multiple inheritance, so I chose
+// not to anyway).
+//
+// Latest changes by Christian Holm Christensen
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "AliFMDSDigit.h" // ALIFMDDIGIT_H
+#include "Riostream.h" // ROOT_Riostream
+#include <TString.h>
+
+//====================================================================
+ClassImp(AliFMDSDigit)
+
+//____________________________________________________________________
+AliFMDSDigit::AliFMDSDigit()
+ : fEdep(0),
+ fCount1(0),
+ fCount2(-1),
+ fCount3(-1)
+{
+ // cTOR
+}
+
+//____________________________________________________________________
+AliFMDSDigit::AliFMDSDigit(UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip,
+ Float_t edep,
+ UShort_t count1,
+ Short_t count2,
+ Short_t count3)
+ : AliFMDBaseDigit(detector, ring, sector, strip),
+ fEdep(edep),
+ fCount1(count1),
+ fCount2(count2),
+ fCount3(count3)
+{
+ //
+ // Creates a real data digit object
+ //
+ // Parameters
+ //
+ // detector Detector # (1, 2, or 3)
+ // ring Ring ID ('I' or 'O')
+ // sector Sector # (For inner/outer rings: 0-19/0-39)
+ // strip Strip # (For inner/outer rings: 0-511/0-255)
+ // edep Total energy deposited
+ // count1 ADC count (a 10-bit word)
+ // count2 ADC count (a 10-bit word) -1 if not used
+ // count3 ADC count (a 10-bit word) -1 if not used
+}
+
+//____________________________________________________________________
+void
+AliFMDSDigit::Print(Option_t* /* option*/) const
+{
+ // Print digit to standard out
+ AliFMDBaseDigit::Print();
+ cout << "\t" << fEdep << " -> "
+ << fCount1 << " (+ " << fCount2 << " + " << fCount2 << ") = "
+ << Counts() << endl;
+}
+
+//____________________________________________________________________
+//
+// EOF
+//
--- /dev/null
+#ifndef ALIFMDSDIGIT_H
+#define ALIFMDSDIGIT_H
+/** @file AliFMDSDigit.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:37:41 2006
+ @brief Digits for the FMD
+*/
+//___________________________________________________________________
+//
+// Digits classes for the FMD
+// AliFMDBaseDigit - base class
+// AliFMDDigit - Normal (smeared) digit
+// AliFMDSDigit - Summable (non-smeared) digit
+//
+#ifndef ALIFMDBASEDIGIT_H
+# include <AliFMDBaseDigit.h>
+#endif
+//____________________________________________________________________
+/** @class AliFMDSDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
+ @brief class for summable digits
+ @ingroup FMD_base
+ */
+class AliFMDSDigit : public AliFMDBaseDigit
+{
+public:
+ /** CTOR */
+ AliFMDSDigit();
+ /** Constrctor
+ @param detector Detector
+ @param ring Ring
+ @param sector Sector
+ @param strip Strip
+ @param edep Energy deposited
+ @param count ADC (first sample)
+ @param count2 ADC (second sample, or -1 if not used)
+ @param count3 ADC (third sample, or -1 if not used) */
+ AliFMDSDigit(UShort_t detector,
+ Char_t ring='\0',
+ UShort_t sector=0,
+ UShort_t strip=0,
+ Float_t edep=0,
+ UShort_t count=0,
+ Short_t count2=-1,
+ Short_t count3=-1);
+ /** DTOR */
+ virtual ~AliFMDSDigit() {}
+ /** @return ADC count (first sample) */
+ UShort_t Count1() const { return fCount1; }
+ /** @return ADC count (second sample, or -1 if not used) */
+ Short_t Count2() const { return fCount2; }
+ /** @return ADC count (third sample, or -1 if not used) */
+ Short_t Count3() const { return fCount3; }
+ /** @return Canonical ADC counts */
+ UShort_t Counts() const;
+ /** @return Energy deposited */
+ Float_t Edep() const { return fEdep; }
+ /** Print info
+ @param opt Not used */
+ void Print(Option_t* opt="") const;
+protected:
+ Float_t fEdep; // Energy deposited
+ UShort_t fCount1; // Digital signal
+ Short_t fCount2; // Digital signal (-1 if not used)
+ Short_t fCount3; // Digital signal (-1 if not used)
+ ClassDef(AliFMDSDigit,1) // Summable FMD digit
+};
+
+inline UShort_t
+AliFMDSDigit::Counts() const
+{
+ return fCount1
+ + (fCount2 >= 0 ? fCount2 : 0)
+ + (fCount3 >= 0 ? fCount3 : 0);
+}
+
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+// mode: C++
+// End:
+//
+//
+// EOF
+//
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 2004, 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$ */
+/** @file AliFMDSDigitizer.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:38:26 2006
+ @brief FMD Digitizers implementation
+ @ingroup FMD_sim
+*/
+//////////////////////////////////////////////////////////////////////////////
+//
+// This class contains the procedures simulation ADC signal for the
+// Forward Multiplicity detector : Hits->Digits and Hits->SDigits
+//
+// Digits consists of
+// - Detector #
+// - Ring ID
+// - Sector #
+// - 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.
+//
+// +---------------------+
+// | AliFMDBaseDigitizer |
+// +---------------------+
+// ^
+// |
+// +----------+---------+
+// | |
+// +-----------------+ +------------------+
+// | AliFMDDigitizer | | AliFMDSDigitizer |
+// +-----------------+ +------------------+
+//
+// These classes has several paramters:
+//
+// fPedestal
+// fPedestalWidth
+// (Only AliFMDDigitizer)
+// Mean and width of the pedestal. The pedestal is simulated
+// by a Guassian, but derived classes my override MakePedestal
+// to simulate it differently (or pick it up from a database).
+//
+// fVA1MipRange
+// The dymamic MIP range of the VA1_ALICE pre-amplifier chip
+//
+// fAltroChannelSize
+// The largest number plus one that can be stored in one
+// channel in one time step in the ALTRO ADC chip.
+//
+// fSampleRate
+// How many times the ALTRO ADC chip samples the VA1_ALICE
+// pre-amplifier signal. The VA1_ALICE chip is read-out at
+// 10MHz, while it's possible to drive the ALTRO chip at
+// 25MHz. That means, that the ALTRO chip can have time to
+// sample each VA1_ALICE signal up to 2 times. Although it's
+// not certain this feature will be used in the production,
+// we'd like have the option, and so it should be reflected in
+// the code.
+//
+//
+// The shaping function of the VA1_ALICE is generally given by
+//
+// f(x) = A(1 - exp(-Bx))
+//
+// where A is the total charge collected in the pre-amp., and B is a
+// paramter that depends on the shaping time of the VA1_ALICE circut.
+//
+// When simulating the shaping function of the VA1_ALICe
+// pre-amp. chip, we have to take into account, that the shaping
+// function depends on the previous value of read from the pre-amp.
+//
+// That results in the following algorithm:
+//
+// last = 0;
+// FOR charge IN pre-amp. charge train DO
+// IF last < charge THEN
+// f(t) = (charge - last) * (1 - exp(-B * t)) + last
+// ELSE
+// f(t) = (last - charge) * exp(-B * t) + charge)
+// ENDIF
+// FOR i IN # samples DO
+// adc_i = f(i / (# samples))
+// DONE
+// last = charge
+// DONE
+//
+// Here,
+//
+// pre-amp. charge train
+// is a series of 128 charges read from the VA1_ALICE chip
+//
+// # samples
+// is the number of times the ALTRO ADC samples each of the 128
+// charges from the pre-amp.
+//
+// Where Q is the total charge collected by the VA1_ALICE
+// pre-amplifier. Q is then given by
+//
+// E S
+// Q = - -
+// e R
+//
+// where E is the total energy deposited in a silicon strip, R is the
+// dynamic range of the VA1_ALICE pre-amp (fVA1MipRange), e is the
+// energy deposited by a single MIP, and S ALTRO channel size in each
+// time step (fAltroChannelSize).
+//
+// The energy deposited per MIP is given by
+//
+// e = M * rho * w
+//
+// where M is the universal number 1.664, rho is the density of
+// silicon, and w is the depth of the silicon sensor.
+//
+// The final ADC count is given by
+//
+// C' = C + P
+//
+// where P is the (randomized) pedestal (see MakePedestal)
+//
+// This class uses the class template AliFMDMap<Type> to make an
+// internal cache of the energy deposted of the hits. The class
+// template is instantasized as
+//
+// typedef AliFMDMap<std::pair<Float_t, UShort_t> > AliFMDEdepMap;
+//
+// The first member of the values is the summed energy deposition in a
+// given strip, while the second member of the values is the number of
+// hits in a given strip. Using the second member, it's possible to
+// do some checks on just how many times a strip got hit, and what
+// kind of error we get in our reconstructed hits. Note, that this
+// information is currently not written to the digits tree. I think a
+// QA (Quality Assurance) digit tree is better suited for that task.
+// However, the information is there to be used in the future.
+//
+//
+// Latest changes by Christian Holm Christensen
+//
+//////////////////////////////////////////////////////////////////////////////
+
+// /1
+// | A(-1 + B + exp(-B))
+// | f(x) dx = ------------------- = 1
+// | B
+// / 0
+//
+// and B is the a parameter defined by the shaping time (fShapingTime).
+//
+// Solving the above equation, for A gives
+//
+// B
+// A = ----------------
+// -1 + B + exp(-B)
+//
+// So, if we define the function g: [0,1] -> [0:1] by
+//
+// / v
+// | Bu + exp(-Bu) - Bv - exp(-Bv)
+// g(u,v) = | f(x) dx = -A -----------------------------
+// | B
+// / u
+//
+// we can evaluate the ALTRO sample of the VA1_ALICE pre-amp between
+// any two times (u, v), by
+//
+//
+// B Bu + exp(-Bu) - Bv - exp(-Bv)
+// C = Q g(u,v) = - Q ---------------- -----------------------------
+// -1 + B + exp(-B) B
+//
+// Bu + exp(-Bu) - Bv - exp(-Bv)
+// = - Q -----------------------------
+// -1 + B + exp(-B)
+//
+
+#include <TTree.h> // ROOT_TTree
+//#include <TRandom.h> // ROOT_TRandom
+#include <AliLog.h> // ALILOG_H
+#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
+}
+
+//____________________________________________________________________
+AliFMDSDigitizer::AliFMDSDigitizer(const Char_t* headerFile,
+ const Char_t* /* sdigfile */)
+ : AliFMDBaseDigitizer("FMDSDigitizer", "FMD SDigitizer")
+{
+ // Normal CTOR
+ AliDebug(1," processed");
+
+ fRunLoader = AliRunLoader::GetRunLoader(); // Open(headerFile);
+ if (!fRunLoader)
+ Fatal("AliFMDSDigitizer", "cannot open session, header file '%s'",
+ 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();
+}
+
+//____________________________________________________________________
+void
+AliFMDSDigitizer::Exec(Option_t*)
+{
+ // Get the output manager
+ if (!fRunLoader) {
+ Error("Exec", "Run loader is not set");
+ return;
+ }
+ if (!fRunLoader->GetAliRun()) fRunLoader->LoadgAlice();
+ if (!fRunLoader->TreeE()) fRunLoader->LoadHeader();
+
+ AliLoader* fmdLoader = fRunLoader->GetLoader("FMDLoader");
+ if (!fmdLoader) Fatal("Exec", "no FMD loader");
+
+ // 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 nEvents = Int_t(fRunLoader->TreeE()->GetEntries());
+ for (Int_t event = 0; event < nEvents; event++) {
+ AliDebug(1,Form(" Digitizing event number %d", event));
+ // Get the current loader
+ fRunLoader->GetEvent(event);
+
+ if (!fmdLoader->TreeS()) fmdLoader->MakeTree("S");
+ // Make a branch
+ fmd->MakeBranch("S");
+
+ // Cache contriutions
+ SumContributions(fmd);
+
+ // Digitize the event
+ DigitizeHits(fmd);
+
+ fmdLoader->TreeS()->Reset();
+ fmdLoader->TreeS()->Fill();
+ fmdLoader->WriteSDigits("OVERWRITE");
+ }
+}
+
+//____________________________________________________________________
+void
+AliFMDSDigitizer::AddDigit(AliFMD* fmd,
+ UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip,
+ Float_t edep,
+ UShort_t count1,
+ Short_t count2,
+ Short_t count3) const
+{
+ // Add a summable digit
+ fmd->AddSDigitByFields(detector, ring, sector, strip, edep,
+ count1, count2, count3);
+}
+
+
+
+//____________________________________________________________________
+//
+// EOF
+//
+
+
+
+
--- /dev/null
+#ifndef ALIFMDSDIGITIZER_H
+#define ALIFMDSDIGITIZER_H
+/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
+ * reserved.
+ *
+ * See cxx source for full Copyright notice
+ */
+// Classses to make Hits into digits and summable digits.
+//
+// Digits consists of
+// - Detector #
+// - Ring ID
+// - Sector #
+// - Strip #
+// - ADC count in this channel
+//
+// Summable digits consists of
+// - Detector #
+// - Ring ID
+// - Sector #
+// - Strip #
+// - Total energy deposited in the strip
+// - ADC count in this channel
+//
+/** @file AliFMDSDigitizer.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:38:26 2006
+ @brief FMD Digitizers declaration
+ @ingroup FMD_sim
+*/
+#ifndef ALIFMDBASEDIGITIZER_H
+# include <AliFMDBaseDigitizer.h>
+#endif
+
+//====================================================================
+/** @class AliFMDSDigitizer AliFMDDigitizer.h <FMD/AliFMDDigitizer.h>
+ @brief Concrete implementation to make summable digits.
+ See also class documentation of AliFMDBaseDigitizer
+ @ingroup FMD_sim
+ */
+class AliFMDSDigitizer : public AliFMDBaseDigitizer
+{
+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="");
+ /** DTOR */
+ virtual ~AliFMDSDigitizer();
+ /** Do it all
+ @param option Not used */
+ virtual void Exec(Option_t* option=0);
+protected:
+ /** Add a digit to output.
+ @param fmd Pointer to detector object
+ @param detector Detector #
+ @param ring Ring ID
+ @param sector Sector number
+ @param strip Strip number
+ @param edep Energy deposited (not used)
+ @param count1 ADC count 1
+ @param count2 ADC count 2 (-1 if not used)
+ @param count3 ADC count 3 (-1 if not used) */
+ virtual void AddDigit(AliFMD* fmd,
+ UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip,
+ Float_t edep,
+ UShort_t count1,
+ Short_t count2,
+ Short_t count3) const;
+ ClassDef(AliFMDSDigitizer,0) // Make Summable Digits from Hits
+};
+
+
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+// mode: C++
+// End:
+//
+//
+// EOF
+//
+
@date Mon Mar 27 12:48:18 2006
@brief Per strip of unisgned shorts (16 bit) data
*/
+// Map of an integer per strip
+// This class stores one short unsigned integer (16 bits) per strip in
+// the FMD detectors.
#ifndef ALIFMDMAP_H
# include "AliFMDMap.h"
#endif
@date Mon Mar 27 12:48:51 2006
@brief Concrete implementation of FMD detector driver - detailed
version
+ @ingroup FMD_sim
*/
//____________________________________________________________________
//
#include <AliMC.h> // ALIMC_H
#include <AliLog.h> // ALILOG_H
#include "AliFMDv1.h" // ALIFMDV1_H
-#include "AliFMDGeometryBuilder.h"
+// #include "AliFMDGeometryBuilder.h"
#include "AliFMDGeometry.h"
#include "AliFMDDetector.h"
#include "AliFMDRing.h"
AliFMDv1::VMC2FMD(TLorentzVector& v, UShort_t& detector,
Char_t& ring, UShort_t& sector, UShort_t& strip) const
{
+ // Convert VMC coordinates to detector coordinates
TVirtualMC* mc = TVirtualMC::GetMC();
AliFMDGeometry* fmd = AliFMDGeometry::Instance();
UShort_t& detector, Char_t& ring,
UShort_t& sector, UShort_t& strip) const
{
+ // Convert VMC coordinates to detector coordinates
TVirtualMC* mc = TVirtualMC::GetMC();
AliFMDGeometry* fmd = AliFMDGeometry::Instance();
AliFMDv1::CheckHit(Int_t trackno, Int_t pdg, Float_t absQ,
const TLorentzVector& p, Float_t edep) const
{
+ // Check that a hit is good
if (AliLog::GetDebugLevel("FMD", "AliFMD") < 5) return kFALSE;
TVirtualMC* mc = TVirtualMC::GetMC();
Double_t mass = mc->TrackMass();
// #pragma link C++ class AliFMDMap<std::pair<Float_t,UShort_t> >;
// #pragma link C++ typedef AliFMDEdepMap;
#pragma link C++ class AliFMDInput;
-#pragma link C++ class AliFMDInputHits;
-#pragma link C++ class AliFMDInputDigits;
-#pragma link C++ class AliFMDInputSDigits;
-#pragma link C++ class AliFMDInputRecPoints;
#pragma link C++ class AliFMDDisplay;
#pragma link C++ class AliFMDCalibFaker;
#pragma link C++ class AliFMDAlignFaker;
# $Id$
SRCS = AliFMDIndex.cxx \
+ AliFMDBaseDigit.cxx \
AliFMDDigit.cxx \
+ AliFMDSDigit.cxx \
AliFMDBoolMap.cxx \
AliFMDUShortMap.cxx \
AliFMDCalibPedestal.cxx \
# AliFMDAltroIO.cxx
-HDRS = $(SRCS:.cxx=.h)
+HDRS = $(SRCS:.cxx=.h)
DHDR := FMDbaseLinkDef.h
EINCLUDE := RAW
AliFMDv0.cxx \
AliFMDv1.cxx \
AliFMDGeometryBuilder.cxx \
+ AliFMDPoints.cxx \
AliFMDHit.cxx \
+ AliFMDBaseDigitizer.cxx \
AliFMDDigitizer.cxx \
+ AliFMDSDigitizer.cxx \
AliFMDEdepMap.cxx \
AliFMDRawWriter.cxx \
-HDRS = $(SRCS:.cxx=.h)
+HDRS = $(SRCS:.cxx=.h) AliFMDEdepHitPair.h
DHDR := FMDsimLinkDef.h
EINCLUDE := RAW