//
// Concrete implementation of AliFMDDetector
//
-// This implements the geometry for FMD1
+// This implements the geometry for FMD1.
// FMD1 has only one ring, of type `inner'.
// It is sitting at z=320.
-// It is the FMD ring with highest eta
+// It is the FMD ring with highest eta.
+// FMD1 currently has no support defined.
//
#include "AliFMD1.h" // ALIFMD1_H
// #include "AliFMDRing.h" // ALIFMDRING_H
// The FMD2 has two ring, one of both types.
// FMD2 is mounted on the space-frame via 4 flanges
// Support is not fleshed ot yet.
+// Support will be simple compared to FMD3.
//
#include "AliFMD2.h" // ALIFMD2_H
// #include "AliFMDRing.h" // ALIFMDRING_H
// This has 2 rings.
// The support of the FMD3 is a carbon-fibre cone, attached to the ITS
// support via flanges. The cone also supports the beam-pipe.
+// The support is a special cone of carbon-fibre made by a Danish
+// Yacht company.
//
#include "AliFMD3.h" // ALIFMD3_H
#include "AliLog.h" // ALILOG_H
//
// 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.
+// 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 # |
// +---------------+---------+------------+
//
-//
+// The mapping is done purely by calculations. In the future,
+// however, we may need some hard-coded stuff, or an external file to
+// read from.
//
#include "AliFMDAltroMapping.h" // ALIFMDALTROMAPPING_H
#include "AliFMDParameters.h"
ULong_t
AliFMDBaseDigit::Hash() const
{
+ // Calculate a hash value based on the detector coordinates.
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
{
+ // Compare to other digit. If the passed pointer to TObject does
+ // not point to an object of class AliFMDBaseDigit (or one of it's
+ // derived classes), then a fatal exception is made.
+ //
+ // Returns -1, if this object's detector coordinates are smaller
+ // than passed object's detector coordinates.
+ //
+ // Returns 0, if this object's detector coordinates is the same as
+ // passed object's detector coordinates.
+ //
+ // Returns 1, if this object's detector coordinates are larger
+ // than passed object's detector coordinates.
if (!o)
AliFatal("Can not compare to NULL!");
if (o->IsA() != AliFMDBaseDigit::Class())
#include "AliFMDDetector.h" // ALIFMDDETECTOR_H
#include "AliFMDRing.h" // ALIFMDRING_H
#include "AliFMDHit.h" // ALIFMDHIT_H
-#include "AliFMDDigit.h" // ALIFMDDIGIT_H
+// #include "AliFMDDigit.h" // ALIFMDDIGIT_H
#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
-#include <AliRunDigitizer.h> // ALIRUNDIGITIZER_H
+// #include <AliRunDigitizer.h> // ALIRUNDIGITIZER_H
//#include <AliRun.h> // ALIRUN_H
#include <AliLoader.h> // ALILOADER_H
#include <AliRunLoader.h> // ALIRUNLOADER_H
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) {
// the bit mask passed to the constructor, or added by `AddCalib'.
//
// The default is to write all calibration parameters to a local
-// storage `local://cdb' which is a directory in the current
-// directory.
+// storage `local://$ALICE_ROOT' which is were the sources live (sigh!
+// - why oh why do we need to shit where we eat - it's just not
+// healty).
//
#include "AliLog.h" // ALILOG_H
#include "AliFMDCalibFaker.h" // ALIFMDCALIBFAKER_H
// retrived from DCS or the like.
//
#include "AliFMDCalibSampleRate.h" // ALIFMDCALIBGAIN_H
-#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
+// #include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
#include <AliLog.h>
//____________________________________________________________________
// This information comes from DCS or the like.
//
#include "AliFMDCalibStripRange.h" // ALIFMDCALIBGAIN_H
-#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
+// #include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
//____________________________________________________________________
ClassImp(AliFMDCalibStripRange)
//____________________________________________________________________
//
+// AliFMDDetector.
+//
+// Base class for concrete FMD detectors, like AliFMD1, AliFMD2,
+// AliFMD3.
// Utility class to help implement the FMD geometry. This provides
// the interface for the concrete geometry implementations of the FMD
// sub-detectors.
#include <AliLog.h> // ALILOG_H
#include "AliFMDDigitizer.h" // ALIFMDDIGITIZER_H
#include "AliFMD.h" // ALIFMD_H
-#include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
-#include "AliFMDDetector.h" // ALIFMDDETECTOR_H
-#include "AliFMDRing.h" // ALIFMDRING_H
-#include "AliFMDHit.h" // ALIFMDHIT_H
+// #include "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
//
// This class is a singleton that handles the geometry parameters of
// the FMD detectors.
+// The actual code is done by various separate classes.
//
#ifndef ALIGEOMETRY_H
# include <AliGeometry.h>
//____________________________________________________________________
//
// 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 "AliFMD1.h" // ALIFMD1_H
#include "AliFMD2.h" // ALIFMD2_H
#include "AliFMD3.h" // ALIFMD3_H
-#include "AliFMD.h" // ALIFMD_H
+// #include "AliFMD.h" // ALIFMD_H
#include "AliLog.h" // ALILOG_H
#include <TGeoVolume.h> // ROOT_TGeoVolume
#include <TGeoTube.h> // ROOT_TGeoTube
//
// This class is a singleton that handles various parameters of
// the FMD detectors.
-// Eventually, this class will use the Conditions DB to get the
-// various parameters, which code can then request from here.
+// The manager normally serves the parameters from the Conditions
+// Database (CDB). These are retrivied by the member function
+// `Init'. Optionally, the class can serve hard-coded constants, if
+// no CDB is available.
//
#include "AliLog.h" // ALILOG_H
#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
#include <AliCDBEntry.h> // ALICDBMANAGER_H
#include <Riostream.h>
#include <sstream>
+#include <TArrayF.h>
+#include <TH2D.h>
//====================================================================
ClassImp(AliFMDParameters)
}
+//__________________________________________________________________
+#define DET2IDX(det,ring,sec,str) \
+ (det * 10000 + (ring == 'I' ? 0 : 1000) + str)
+
+//__________________________________________________________________
+void
+AliFMDParameters::Draw(Option_t* option)
+{
+ TString opt(option);
+ enum {
+ kPulseGain, // Path to PulseGain calib object
+ kThreshold, // Path to PulseGain calib object
+ kPedestal, // Path to Pedestal calib object
+ kPedestalWidth, // Path to Pedestal calib object
+ kDead, // Path to Dead calib object
+ kSampleRate, // Path to SampleRate calib object
+ kAltroMap, // Path to AltroMap calib object
+ kZeroSuppression, // Path to ZeroSuppression cal object
+ kMinStripRange, // Path to strip range cal object
+ kMaxStripRange // Path to strip range cal object
+ } what;
+
+
+ if (opt.Contains("dead", TString::kIgnoreCase))
+ what = kDead;
+ else if (opt.Contains("threshold",TString::kIgnoreCase))
+ what = kThreshold;
+ else if (opt.Contains("gain",TString::kIgnoreCase))
+ what = kPulseGain;
+ else if (opt.Contains("pedestal",TString::kIgnoreCase))
+ what = kPedestal;
+ else if (opt.Contains("noise",TString::kIgnoreCase))
+ what = kPedestalWidth;
+ else if (opt.Contains("zero",TString::kIgnoreCase))
+ what = kZeroSuppression;
+ else if (opt.Contains("rate",TString::kIgnoreCase))
+ what = kSampleRate;
+ else if (opt.Contains("min",TString::kIgnoreCase))
+ what = kMinStripRange;
+ else if (opt.Contains("max",TString::kIgnoreCase))
+ what = kMaxStripRange;
+ else if (opt.Contains("map",TString::kIgnoreCase))
+ what = kAltroMap;
+ else {
+ Warning("Draw", "unknown parameter: %s\n\tShould be one of\n\t"
+ "dead, threshold, gain, pedestal, noise, zero, rate, "
+ "min, max, map",
+ option);
+ return;
+ }
+
+ TArrayD xbins(3 * 512 + 2 * 256 + 5);
+ Int_t i = 1;
+ Bool_t skip = kTRUE;
+ for (UShort_t det = 1; det <= 3; det++) {
+ UShort_t nRings = (det == 1 ? 1 : 2);
+ for (UShort_t iring = 0; iring < nRings; iring++) {
+ UShort_t nStrip = (iring == 0 ? 512 : 256);
+ Char_t ring = (iring == 0 ? 'I' : 'O');
+ for (UShort_t str = 0; str < nStrip; str++) {
+ Int_t idx = DET2IDX(det, ring, 0, str);
+ if (skip) {
+ xbins[i-1] = idx - .5;
+ skip = kFALSE;
+ }
+ xbins[i] = idx + .5;
+ i++;
+ }
+ skip = kTRUE;
+ i++;
+ }
+ }
+ TArrayD ybins(41);
+ for (Int_t i = 0; i < 41; i++) ybins[i] = Float_t(i - .5);
+ TH2D* hist = new TH2D("calib", Form("Calibration %s", option),
+ xbins.fN-1, xbins.fArray,
+ ybins.fN-1, ybins.fArray);
+
+ // hist->Draw("Lego");
+ // return;
+
+ for (UShort_t det = 1; det <= 3; det++) {
+ UShort_t nRings = (det == 1 ? 1 : 2);
+ for (UShort_t iring = 0; iring < nRings; iring++) {
+ UShort_t nSector = (iring == 0 ? 20 : 40);
+ UShort_t nStrip = (iring == 0 ? 512 : 256);
+ Char_t ring = (iring == 0 ? 'I' : 'O');
+ for (UShort_t sec = 0; sec < nSector; sec++) {
+ for (UShort_t str = 0; str < nStrip; str++) {
+ Int_t idx = DET2IDX(det, ring, sec, str);
+ UInt_t ddl, addr;
+ Double_t val = 0;
+ switch (what) {
+ case kPulseGain: // Path to PulseGain calib object
+ val = GetPulseGain(det,ring,sec,str); break;
+ case kThreshold: // Path to PulseGain calib object
+ val = GetThreshold(); break;
+ case kPedestal: // Path to Pedestal calib object
+ val = GetPedestal(det,ring,sec,str); break;
+ case kPedestalWidth: // Path to Pedestal calib object
+ val = GetPedestalWidth(det,ring,sec,str); break;
+ case kDead: // Path to Dead calib object
+ val = IsDead(det,ring,sec,str); break;
+ case kSampleRate: // Path to SampleRate calib object
+ val = GetSampleRate(det,ring,sec,str); break;
+ case kAltroMap: // Path to AltroMap calib object
+ Detector2Hardware(det,ring,sec,str, ddl, addr);
+ val = addr; break;
+ case kZeroSuppression: // Path to ZeroSuppression cal object
+ val = GetZeroSuppression(det,ring,sec,str); break;
+ case kMinStripRange: // Path to strip range cal object
+ val = GetMinStrip(det,ring,sec,str); break;
+ case kMaxStripRange: // Path to strip range cal object
+ val = GetMaxStrip(det,ring,sec,str); break;
+ }
+ hist->Fill(idx,sec,val);
+ }
+ }
+ }
+ }
+ hist->Draw("lego");
+}
+
//__________________________________________________________________
void
AliFMDParameters::Print(Option_t* option) const
/** Print all parameters.
@param option Option string */
void Print(Option_t* option="A") const;
+ /** Draw parameters.
+ @param option What to draw. Should be one of
+ - dead Dead channels
+ - threshold Threshold
+ - gain Gain
+ - pedestal Pedestal
+ - noise Noise (or pedestal width)
+ - zero Zero suppression
+ - rate Sampling rate (VA1 clock / ALTRO clock)
+ - min Minimum strip read out
+ - max Maximum strip read out
+ - map hardware address
+ */
+ void Draw(Option_t* option="pedestal");
/** @{ */
/** @name Set various `Fixed' parameters */
@brief Specialised class for drawing hits in the FMD.
@ingroup FMD_sim
*/
+//____________________________________________________________________
+//
+// AliFMDPoints.
+// Class to draw FMD Hits.
+// Normally, hits are drawn using TPolyMarker3D. However, that's not
+// really appropriate for the FMD. Instead, we use TMarker3DBox.
+//
#ifndef ALIPOINTS_H
# include <AliPoints.h>
#endif
#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
#include "AliFMDDigit.h" // ALIFMDDIGIT_H
#include "AliFMDRawStream.h" // ALIFMDRAWSTREAM_H
-#include "AliRawReader.h" // ALIRAWREADER_H
+// #include "AliRawReader.h" // ALIRAWREADER_H
#include "AliFMDRawReader.h" // ALIFMDRAWREADER_H
// #include "AliFMDAltroIO.h" // ALIFMDALTROIO_H
// #include <TArrayI.h> // ROOT_TArrayI
*
* See cxx source for full Copyright notice
*/
+//____________________________________________________________________
+//
+// Class to read ALTRO formated data from an AliRawReader.
+// This class is mostly here to set AliAltroRawStream::fNoAltroMapping
+// to false. Furthermore, it defines the utility function
+// ReadChannel to read in a full ALTRO channel. The data is unpacked
+// into the passed array.
+//
/** @file AliFMDRawStream.h
@author Christian Holm Christensen <cholm@nbi.dk>
@date Tue Mar 28 12:53:26 2006
//____________________________________________________________________
//
// This is a class that constructs AliFMDRecPoint objects from of Digits
-//
-// This class reads either digits from a TClonesArray or raw data from
+// 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
-// internal cache (fAdcs).
+// internal cache (fAdcs). The rec-points are made via the naiive
+// method.
//
//-- Authors: Evgeny Karpechev(INR) and Alla Maevsksia
// Latest changes by Christian Holm Christensen <cholm@nbi.dk>
//____________________________________________________________________
#include <AliLog.h> // ALILOG_H
-#include <AliRun.h> // ALIRUN_H
+// #include <AliRun.h> // ALIRUN_H
#include <AliRunLoader.h> // ALIRUNLOADER_H
#include <AliHeader.h> // ALIHEADER_H
#include <AliGenEventHeader.h> // ALIGENEVENTHEADER_H
//__________________________________________________________________
//
// Utility class to help implement collection of FMD modules into
-// rings. This is used by AliFMDDetector and AliFMDGeometry.
-//
+// rings. This is used by AliFMDDetector and AliFMDGeometry.
// The AliFMDGeometry object owns the AliFMDRing objects, and the
// AliFMDDetector objects reference these. That is, the AliFMDRing
// objects are share amoung the AliFMDDetector objects.
// -1 + B + exp(-B)
//
-#include <TTree.h> // ROOT_TTree
+// #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 "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 "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
// contains the base procedures for the Forward Multiplicity detector
// Detector consists of 3 sub-detectors FMD1, FMD2, and FMD3, each of
// which has 1 or 2 rings of silicon sensors.
-//
// This class contains the detailed version of the FMD - that is, hits
// are produced during simulation.
//
{
//____________________________________________________________________
// This part for configuration
- //static EG_t eg = test50;
- //EG_t eg = kParam_fmd;
- EG_t eg = kParam_2000; // kPythia;
+ // EG_t eg = test50;
+ // EG_t eg = kParam_fmd;
+ // EG_t eg = kParam_2000; // kPythia;
+ EG_t eg = kFMDFlat;
Geo_t geo = kNoHoles;
Rad_t rad = kGluonRadiation;
Mag_t mag = k5kG;
case kFMDFlat:
{
comment = comment.Append(" Flat in FMD range");
- AliGenCocktail* gener = AliGenCocktail("FMD cocktail");
- gener->SetPart(211);
+ AliGenCocktail* gener = new AliGenCocktail();
gener->SetMomentumRange(3,4);
gener->SetPhiRange(0, 360);
AliGenBox* gener3 = new AliGenBox(2000);
gener3->SetThetaRange(155.97, 176.73);
+ gener3->SetPart(211);
gener->AddGenerator(gener3, "FMD3", .33);
AliGenBox* gener2 = new AliGenBox(2000);
gener2->SetThetaRange(2.95, 20.42);
+ gener2->SetPart(211);
gener->AddGenerator(gener2, "FMD2", .33);
AliGenBox* gener1 = new AliGenBox(2000);
gener1->SetThetaRange(0.77, 3.08);
+ gener1->SetPart(211);
gener->AddGenerator(gener1, "FMD1", .34);
gGener = gener;
}
void
AliESDFMD::Print(Option_t* /* option*/) const
{
+ // Print all information to standard output.
std::cout << "AliESDFMD:" << std::endl;
for (size_t det = 1; det <= fMultiplicity.MaxDetectors(); det++) {
for (size_t ir = 0; ir < fMultiplicity.MaxRings(); ir++) {
kInvalidEta = 1000
};
protected:
- AliFMDFloatMap fMultiplicity;
- AliFMDFloatMap fEta;
+ AliFMDFloatMap fMultiplicity; // Psuedo multplicity per strip
+ AliFMDFloatMap fEta; // Psuedo-rapidity per strip
ClassDef(AliESDFMD,1) // ESD info from FMD
};
//__________________________________________________________
//
// Map of per strip Float_t information
+// the floats are indexed by the coordinates
+// DETECTOR # (1-3)
+// RING ID ('I' or 'O', any case)
+// SECTOR # (0-39)
+// STRIP # (0-511)
+//
//
// Created Mon Nov 8 12:51:51 2004 by Christian Holm Christensen
//
//____________________________________________________________________
//
// Array of floats indexed by strip identifier.
+// the floats are indexed by the coordinates
+// DETECTOR # (1-3)
+// RING ID ('I' or 'O', any case)
+// SECTOR # (0-39)
+// STRIP # (0-511)
//
class AliFMDFloatMap : public AliFMDMap
{