rule checker in a mail from the 3rd of march, 2011.
All issues fixed, except
- FMD/AliFMDParameters.cxx:832
Rule RC19: In parameters of a method, objects that are passed
by pointer or by reference and that are not modified should be
declared const. Violation: Parameter declaration UShort_t&
det in method AliFMDParameters::Hardware2Detector can be
declared as const type & param
+ This is a false negative - which is obvious from the code
- FMD/AliFMDReconstructor.cxx:332
Rule RC19: In parameters of a method, objects that are passed
by pointer or by reference and that are not modified should be
declared const. Violation: Parameter declaration AliRawReader
reader in method AliFMDReconstructor::Digitize can be declared
as const type param
+ Again, this is a false negative, since the AliRawReader object _is_
modified - the state is changed
- FMD/AliFMDHitDigitizer.cxx:213
Rule RC19: In parameters of a method, objects that are passed
by pointer or by reference and that are not modified should be
declared const. Violation: Parameter declaration AliFMD fmd
in method AliFMDHitDigitizer::AliFMDHitDigitizer can be
declared as const type param
+ Again, false negative. The member fFMD is assigned to the passed
parameter and this is indeed modified several times throughout the
life time of the AliFMDHitDigitizer object.
- FMD/AliFMD3.cxx:123
Rule RC19: In parameters of a method, objects that are passed
by pointer or by reference and that are not modified should be
declared const. Violation: Parameter declaration Option_t opt
in method AliFMD3::ConeR can be declared as const type param
+ False negative. Strange actually, since typedef const char Option_t
- FMD/AliFMDBaseDigitizer.cxx:605
Rule RC19: In parameters of a method, objects that are passed
by pointer or by reference and that are not modified should be
declared const. Violation: Parameter declaration AliLoader
loader in method AliFMDBaseDigitizer::StoreDigits can be
declared as const type param
+ Again, false negative.
- FMD/AliFMDSpectraDisplay.cxx:237
Rule RC19: In parameters of a method, objects that are passed
by pointer or by reference and that are not modified should be
declared const. Violation: Parameter declaration
TGListTreeItem entry in method
AliFMDSpectraDisplay::AliFMDSpectraDisplayTop::HandleEntry can
be declared as const type param
+ This cannot be changed, since the call back from ROOT does not allow
that.
* provided "as is" without express or implied warranty. *
**************************************************************************/
/* $Id$ */
-/** @file AliFMDAlignFaker.cxx
- @author Christian Holm Christensen <cholm@nbi.dk>
- @date Sun Mar 26 17:57:55 2006
- @brief Implementation of AliFMDAlignFaker
-*/
+/**
+ * @file AliFMDAlignFaker.cxx
+ * @author Christian Holm Christensen <cholm@nbi.dk>
+ * @date Sun Mar 26 17:57:55 2006
+ * @brief Implementation of AliFMDAlignFaker
+ */
//____________________________________________________________________
//
// Class
Bool_t
AliFMDAlignFaker::GetGeometry(Bool_t toCdb, const TString& storage)
{
+ //
+ // Get the geometry
+ //
+ // Parameters:
+ // toCdb Whether to store in CDB
+ // storage Storage element to use
+ //
+ // Return:
+ // true on success
+ //
if (!toCdb) {
//load geom from default CDB storage
AliGeomManager::LoadGeometry();
*
* See cxx source for full Copyright notice
*/
-/** @file AliFMDAlignFaker.h
- @author Christian Holm Christensen <cholm@nbi.dk>
- @date Sun Mar 26 18:26:39 2006
- @brief Make fake alignment
-*/
+/**
+ * @file AliFMDAlignFaker.h
+ * @author Christian Holm Christensen <cholm@nbi.dk>
+ * @date Sun Mar 26 18:26:39 2006
+ * @brief Make fake alignment
+ */
//____________________________________________________________________
//
// Class
class TClonesArray;
class TString;
-/** @class AliFMDAlignFaker
- @brief This task creates fake alignment.
- Which alignment, depends on the bit mask passed to the
- constructor, or added by `AddAlign'.
-
- The default is to write all alignment parameters to a local
- storage @c local://cdb which is a directory in the current
- directory.
- @ingroup FMD_util
-*/
+/**
+ * @class AliFMDAlignFaker
+ * @brief This task creates fake alignment.
+ *
+ * Which alignment, depends on the bit mask passed to the
+ * constructor, or added by `AddAlign'.
+ *
+ * The default is to write all alignment parameters to a local
+ * storage @c local://cdb which is a directory in the current
+ * directory.
+ *
+ * @ingroup FMD_util
+ */
class AliFMDAlignFaker : public TTask
{
public:
- /** What to make alignments for */
+ /**
+ * What to make alignments for
+ */
enum EWhat {
/** MAke alignment for sensors */
kSensors = 1,
/** All types of alignment */
kAll = (1<<kHalves|1<<kSensors)
};
- /** Constructor
+ /**
+ * Constructor
@param mask Bit mask of what to make alignments for
@param geo File to read geometry from, if needed
- @param loc Where to store the result */
+ @param loc Where to store the result
+ */
AliFMDAlignFaker(Int_t mask=kAll,
const char* geo="geometry.root",
const char* loc="");
- /** Destructor */
+ /**
+ * Destructor
+ */
virtual ~AliFMDAlignFaker() {}
- /** Add something to make alignment for
- @param w Bit of alignment mask */
+ /**
+ * Add something to make alignment for
+ * @param w Bit of alignment mask
+ */
void AddAlign(EWhat w) { SETBIT(fMask, w); }
- /** Remove something to make alignment for
- @param w Bit of alignment mask */
+ /**
+ * Remove something to make alignment for
+ * @param w Bit of alignment mask
+ */
void RemoveAlign(EWhat w) { CLRBIT(fMask, w); }
- /** Set alignment select mask
- @param mask Bit mask */
+ /**
+ * Set alignment select mask
+ * @param mask Bit mask
+ */
void SetAlign(Int_t mask) { fMask = mask; }
- /** Set the displacement (translation) of sensors. The displacement
- is selected random uniformly between the corresponding minimum
- and maximum.
- @param x1 Minimum X displacement (in centimeters)
- @param y1 Minimum Y displacement (in centimeters)
- @param z1 Minimum Z displacement (in centimeters)
- @param x2 Maximum X displacement (in centimeters)
- @param y2 Maximum Y displacement (in centimeters)
- @param z2 Maximum Z displacement (in centimeters) */
+ /**
+ * Set the displacement (translation) of sensors. The displacement
+ * is selected random uniformly between the corresponding minimum
+ * and maximum.
+ * @param x1 Minimum X displacement (in centimeters)
+ * @param y1 Minimum Y displacement (in centimeters)
+ * @param z1 Minimum Z displacement (in centimeters)
+ * @param x2 Maximum X displacement (in centimeters)
+ * @param y2 Maximum Y displacement (in centimeters)
+ * @param z2 Maximum Z displacement (in centimeters)
+ */
void SetSensorDisplacement(Double_t x1=0, Double_t y1=0, Double_t z1=0,
Double_t x2=.01, Double_t y2=.01, Double_t z2=0);
- /** Set the rotation of sensors. The displacement is selected
- random uniformly between the corresponding minimum and maximum.
- @param x1 Minimum X rotation (in degrees)
- @param y1 Minimum Y rotation (in degrees)
- @param z1 Minimum Z rotation (in degrees)
- @param x2 Maximum X rotation (in degrees)
- @param y2 Maximum Y rotation (in degrees)
- @param z2 Maximum Z rotation (in degrees) */
+ /**
+ * Set the rotation of sensors. The displacement is selected
+ * random uniformly between the corresponding minimum and maximum.
+ * @param x1 Minimum X rotation (in degrees)
+ * @param y1 Minimum Y rotation (in degrees)
+ * @param z1 Minimum Z rotation (in degrees)
+ * @param x2 Maximum X rotation (in degrees)
+ * @param y2 Maximum Y rotation (in degrees)
+ * @param z2 Maximum Z rotation (in degrees)
+ */
void SetSensorRotation(Double_t x1=0, Double_t y1=0, Double_t z1=0,
Double_t x2=.5, Double_t y2=.5, Double_t z2=.5);
- /** Set the displacement (translation) of half-rings. The
- displacement is selected random uniformly between the
- corresponding minimum and maximum.
- @param x1 Minimum X displacement
- @param y1 Minimum Y displacement
- @param z1 Minimum Z displacement
- @param x2 Maximum X displacement
- @param y2 Maximum Y displacement
- @param z2 Maximum Z displacement */
+ /**
+ * Set the displacement (translation) of half-rings. The
+ * displacement is selected random uniformly between the
+ * corresponding minimum and maximum.
+ * @param x1 Minimum X displacement
+ * @param y1 Minimum Y displacement
+ * @param z1 Minimum Z displacement
+ * @param x2 Maximum X displacement
+ * @param y2 Maximum Y displacement
+ * @param z2 Maximum Z displacement
+ */
void SetHalfDisplacement(Double_t x1=0, Double_t y1=0, Double_t z1=0,
Double_t x2=.05, Double_t y2=.05, Double_t z2=.05);
- /** Set the rotation of half-rings. The displacement is selected
- random uniformly between the corresponding minimum and maximum.
- @param x1 Minimum X rotation (in degrees)
- @param y1 Minimum Y rotation (in degrees)
- @param z1 Minimum Z rotation (in degrees)
- @param x2 Maximum X rotation (in degrees)
- @param y2 Maximum Y rotation (in degrees)
- @param z2 Maximum Z rotation (in degrees) */
+ /**
+ * Set the rotation of half-rings. The displacement is selected
+ * random uniformly between the corresponding minimum and maximum.
+ * @param x1 Minimum X rotation (in degrees)
+ * @param y1 Minimum Y rotation (in degrees)
+ * @param z1 Minimum Z rotation (in degrees)
+ * @param x2 Maximum X rotation (in degrees)
+ * @param y2 Maximum Y rotation (in degrees)
+ * @param z2 Maximum Z rotation (in degrees)
+ */
void SetHalfRotation(Double_t x1=0, Double_t y1=0, Double_t z1=0,
Double_t x2=0, Double_t y2=0, Double_t z2=0);
- /** Set the output file name. Should be a valid CDB URL.
- @param file CDB URL */
+ /**
+ * Set the output file name. Should be a valid CDB URL.
+ * @param file CDB URL
+ */
void SetOutput(const char* file) { SetTitle(file); }
- /** Set the file to read the geometry from.
- @param file File name */
+ /**
+ * Set the file to read the geometry from.
+ * @param file File name
+ */
void SetGeometryFile(const char* file) { SetName(file); }
- /** Set the comment */
+ /**
+ * Set the comment
+ */
void SetComment(const Char_t* comment="dummy data") { fComment = comment; }
- /** Make the alignment objects.
- @param option Not used. */
+ /**
+ * Make the alignment objects.
+ * @param option Not used.
+ */
void Exec(Option_t* option="");
- /** Get the geometry */
+ /**
+ * Get the geometry
+ *
+ * @param toCdb Whether to store in CDB
+ * @param storage Storage element to use
+ *
+ * @return true on success
+ */
static Bool_t GetGeometry(Bool_t toCdb=kFALSE,
const TString& storage=TString());
protected:
+ /**
+ * Copy constructor
+ *
+ * @param o Object to copy from
+ */
AliFMDAlignFaker(const AliFMDAlignFaker& o)
: TTask(o),
fMask(0),
fRunMax(0),
fArray(0),
fComment("")
-{}
+ {}
+ /**
+ * Assignment operator
+ *
+ *
+ * @return Reference to this
+ */
AliFMDAlignFaker& operator=(const AliFMDAlignFaker&) { return *this; }
- /** Make the alignment object for a path
- @param path Node path.
- @param volID Volume identifier
- @param transX Translation in X
- @param transY Translation in Y
- @param transZ Translation in Z
- @param rotX Rotation around X axis
- @param rotY Rotation around Y axis
- @param rotZ Rotation around Z axis
- @return @c true on success */
+ /**
+ * Make the alignment object for a path
+ * @param path Node path.
+ * @param volID Volume identifier
+ * @param transX Translation in X
+ * @param transY Translation in Y
+ * @param transZ Translation in Z
+ * @param rotX Rotation around X axis
+ * @param rotY Rotation around Y axis
+ * @param rotZ Rotation around Z axis
+ * @return @c true on success
+ */
Bool_t MakeAlign(const TString& path, Int_t volID,
Double_t transX, Double_t transY, Double_t transZ,
Double_t rotX, Double_t rotY, Double_t rotZ);
- /** Align a sensor
- @param path of a sensor
- @param id Volume id */
+ /**
+ * Align a sensor
+ * @param path of a sensor
+ * @param id Volume id
+ */
Bool_t MakeAlignSensor(const TString& path, Int_t id);
- /** Align a half-ring
- @param path of a sensor
- @param id Volume id */
+ /**
+ * Align a half-ring
+ * @param path of a sensor
+ * @param id Volume id
+ */
Bool_t MakeAlignHalf(const TString& path, Int_t id);
- /** Write to CDB */
+ /**
+ * Write to CDB
+ */
void WriteToCDB();
- /** Write to file */
+ /**
+ * Write to file
+ */
void WriteToFile();
Long_t fMask; // What to write
TVector3 fSensorTransMin; // Minimum translations of a sensor
stripOff = (sec % 2 ? -1 : 1) * t / sampleRate;
}
-#if 0
-//____________________________________________________________________
-Bool_t
-AliFMDAltroMapping::Hardware2Detector(UInt_t ddl, UInt_t board,
- UInt_t altro, UInt_t chan,
- UShort_t& det, Char_t& ring,
- UShort_t& sec, Short_t& str) const
-{
- // See also Hardware2Detector that requires 3 inputs
- det = DDL2Detector(ddl);
- return Channel2StripBase(board, altro, chan, ring, sec, str);
-}
-
-
-//____________________________________________________________________
-Bool_t
-AliFMDAltroMapping::Hardware2Detector(UInt_t ddl, UInt_t addr,
- UShort_t& det, Char_t& ring,
- UShort_t& sec, Short_t& str) const
-{
- // Translate a hardware address to detector coordinates.
- //
- // See also Hardware2Detector that accepts 4 inputs
- UShort_t board, altro, chan;
- ChannelAddress(addr, board, altro, chan);
- return Hardware2Detector(ddl,board, altro, chan, det,ring, sec, str);
-}
-#endif
-
//____________________________________________________________________
Bool_t
AliFMDAltroMapping::Hardware2Detector(UShort_t ddl, UShort_t board,
Short_t
AliFMDAltroMapping::Sector2Board(Char_t ring, UShort_t sec) const
{
+ //
+ // Return board address corresponding to a sector
+ //
+ // Parameters:
+ // ring Ring identifier
+ // sec Sector number
+ // Return:
+ // The board number, or negative number in case of failure
+ //
switch (ring) {
case 'I':
case 'i':
UShort_t sam, UShort_t preSamples,
UShort_t sampleRate) const
{
+ //
+ // Get the timebin correspoding to a strip and sample
+ //
+ // Parameters:
+ // sec Sector number
+ // str Strip number
+ // sam Sample number
+ // preSamples Number of pre-samples.
+ // sampleRate The over-sampling rate
+ // Return:
+ // the timebin corresponding to the passed strip
+ //
UShort_t timebin = preSamples;
if (sec % 2) timebin += (127 - (strip % 128)) * sampleRate;
else timebin += (strip % 128) * sampleRate;
return timebin;
}
-#if 0
-//_____________________________________________ _______________________
-Bool_t
-AliFMDAltroMapping::Detector2Hardware(UShort_t det, Char_t ring,
- UShort_t sec, UShort_t str,
- UShort_t& ddl, UShort_t& board,
- UShort_t& altro, UShort_t& chan) const
-{
- ddl = Detector2DDL(det);
- return Strip2Channel(ring, sec, str, board, altro, chan);
-}
-
-
-//____________________________________________________________________
-Bool_t
-AliFMDAltroMapping::Detector2Hardware(UShort_t det, Char_t ring,
- UShort_t sec, UShort_t str,
- UShort_t& ddl, UShort_t& addr) const
-{
- // Translate detector coordinates to a hardware address.
- //
- // See also Detector2Hardware that returns 4 parameters.
- UShort_t board = 0;
- UShort_t altro = 0;
- UShort_t chan = 0;
- if (!Detector2Hardware(det,ring,sec,str,ddl,board,altro,chan)) return kFALSE;
- addr = ChannelAddress(board, altro, chan);
- return kTRUE;
-}
-#endif
//____________________________________________________________________
Bool_t
UShort_t& altro, UShort_t& channel,
UShort_t& timebin) const
{
+ //
+ // Map a detector index into a hardware address.
+ //
+ // Parameters:
+ // det The detector #
+ // ring The ring ID
+ // sec The sector #
+ // str The strip #
+ // sam The sample number
+ // preSamples Number of pre-samples
+ // sampleRate The oversampling rate
+ // ddl On return, hardware DDL number
+ // board On return, the FEC board address (local to DDL)
+ // altro On return, the ALTRO number (local to FEC)
+ // channel On return, the channel number (local to ALTRO)
+ // timebin On return, the timebin number (local to ALTRO)
+ // Return:
+ // @c true on success, false otherwise
+ //
ddl = Detector2DDL(det);
if (!Strip2Channel(ring,sec,str,board,altro,channel)) return kFALSE;
timebin = Strip2Timebin(sec, str, sam, preSamples, sampleRate);
UShort_t& ddl, UShort_t& hwaddr,
UShort_t& timebin) const
{
+ //
+ // Map a detector index into a hardware address.
+ //
+ // Parameters:
+ // det The detector #
+ // ring The ring ID
+ // sec The sector #
+ // str The strip #
+ // sam The sample number
+ // preSamples Number of pre-samples
+ // sampleRate The oversampling rate
+ // ddl On return, hardware DDL number
+ // hwaddr On return, hardware address.
+ // timebin On return, the timebin number (local to ALTRO)
+ // Return:
+ // @c true on success, false otherwise
+ //
UShort_t board = 0;
UShort_t altro = 0;
UShort_t chan = 0;
AliFMDAltroMapping::ChannelAddress(UShort_t board, UShort_t altro,
UShort_t channel) const
{
+ //
+ // Convert board, chip, channel to a hardware address
+ //
+ // Parameters:
+ // board Board number
+ // altro Altro number
+ // channel Channel number
+ // Return:
+ // hardware address of a channel
+ //
return (((board & 0x1F) << 7) | ((altro & 0x7) << 4) | (channel & 0xF));
}
AliFMDAltroMapping::ChannelAddress(UShort_t hwaddr, UShort_t& board,
UShort_t& altro, UShort_t& channel) const
{
+ //
+ // Convert a channel address to board, altro, channel fields
+ //
+ // Parameters:
+ // hwaddr Channel address
+ // board On return, the Board number
+ // altro On return, the Altro number
+ // channel On return, the Channel number
+ //
board = ((hwaddr >> 7) & 0x1F);
altro = ((hwaddr >> 4) & 0x07);
channel = ((hwaddr >> 0) & 0x0F);
void
AliFMDAltroMapping::Print(Option_t* option) const
{
+ //
+ // Print map to standard out
+ //
+ // Parameters:
+ // option Option string (hw, or det)
+ //
TString opt(option);
opt.ToLower();
UShort_t ddl, board, chip, chan, addr;
class AliFMDAltroMapping : public AliAltroMapping
{
public:
- /** Constructor */
+ /**
+ * Constructor
+ */
AliFMDAltroMapping();
- /** Destructor */
+ /**
+ * Destructor
+ */
virtual ~AliFMDAltroMapping() {}
- /** Return detector number corresponding to given DDL number
- @param ddl DDL number
- @return Detector number */
+ /**
+ * Return detector number corresponding to given DDL number
+ *
+ * @param ddl DDL number
+ * @return Detector number
+ */
Short_t DDL2Detector(UInt_t ddl) const
{
return (ddl<=2 ? Short_t(ddl + 1) : -1);
}
- /** Return the ring identifier corresponding to a board number
- @param board Board number
- @return Ring identifier */
+ /**
+ * Return the ring identifier corresponding to a board number
+ *
+ * @param board Board number
+ * @return Ring identifier
+ */
Char_t Board2Ring(UShort_t board) const { return (board%2)?'O':'I'; }
- /** Return the strip base number corresponding to a channel address
- @param board Board number
- @param altro Altro number
- @param channel Channel number
- @param ring On return, the ring ID
- @param sec On return, the sector number
- @param strip On return, the strip base offset
- @return @c true on success */
+ /**
+ * Return the strip base number corresponding to a channel address
+ *
+ * @param board Board number
+ * @param altro Altro number
+ * @param channel Channel number
+ * @param ring On return, the ring ID
+ * @param sec On return, the sector number
+ * @param strip On return, the strip base offset
+ * @return @c true on success
+ */
Bool_t Channel2StripBase(UShort_t board, UShort_t altro,
UShort_t chan, Char_t& ring,
UShort_t& sec, Short_t& str) const;
- /** Return the strip, sample corresponding to a timebin
- @param sec Sector
- @param timebin Time bin
- @param preSamples Number of pre-samples
- @param sampleRate Oversampling rate
- @param strip On return, the strip number in this channel
- @param sam On return, the sample number */
+ /**
+ * Return the strip, sample corresponding to a timebin
+ *
+ * @param sec Sector
+ * @param timebin Time bin
+ * @param preSamples Number of pre-samples
+ * @param sampleRate Oversampling rate
+ * @param strip On return, the strip number in this channel
+ * @param sam On return, the sample number
+ */
void Timebin2Strip(UShort_t sec, UShort_t timebin,
UShort_t preSamples, UShort_t sampleRate,
Short_t& strip, UShort_t& sample) const;
- /** Map a hardware address into a detector index.
- @param ddl Hardware DDL number
- @param hwaddr Hardware address.
- @param timebin Timebin
- @param preSamples # of pre samples
- @param sampleRate Over sampling rate
- @param det On return, the detector #
- @param ring On return, the ring ID
- @param sec On return, the sector #
- @param str On return, the base of strip #
- @param sam On return, the sample number for this strip
- @return @c true on success, false otherwise */
+ /**
+ * Map a hardware address into a detector index.
+ *
+ * @param ddl Hardware DDL number
+ * @param hwaddr Hardware address.
+ * @param timebin Timebin
+ * @param preSamples # of pre samples
+ * @param sampleRate Over sampling rate
+ * @param det On return, the detector #
+ * @param ring On return, the ring ID
+ * @param sec On return, the sector #
+ * @param str On return, the base of strip #
+ * @param sam On return, the sample number for this strip
+ * @return @c true on success, false otherwise
+ */
Bool_t Hardware2Detector(UShort_t ddl, UShort_t hwaddr,
UShort_t timebin, UShort_t preSamples,
UShort_t sampleRate,
UShort_t& det, Char_t& ring,
UShort_t& sec, Short_t& str,
UShort_t& sam) const;
- /** Map a hardware address into a detector index.
- @param ddl Hardware DDL number
- @param board FEC number
- @param altro ALTRO number
- @param channel Channel number
- @param timebin Timebin
- @param preSamples # of pre samples
- @param sampleRate Over sampling rate
- @param det On return, the detector #
- @param ring On return, the ring ID
- @param sec On return, the sector #
- @param str On return, the base of strip #
- @param sam On return, the sample number for this strip
- @return @c true on success, false otherwise */
+ /**
+ * Map a hardware address into a detector index.
+ *
+ * @param ddl Hardware DDL number
+ * @param board FEC number
+ * @param altro ALTRO number
+ * @param channel Channel number
+ * @param timebin Timebin
+ * @param preSamples # of pre samples
+ * @param sampleRate Over sampling rate
+ * @param det On return, the detector #
+ * @param ring On return, the ring ID
+ * @param sec On return, the sector #
+ * @param str On return, the base of strip #
+ * @param sam On return, the sample number for this strip
+ * @return @c true on success, false otherwise
+ */
Bool_t Hardware2Detector(UShort_t ddl, UShort_t board,
UShort_t altro, UShort_t chan,
UShort_t timebin, UShort_t preSamples,
- /** Return DDL number corresponding to given detector number
- @param det Detector number
- @return DDL number */
+ /**
+ * Return DDL number corresponding to given detector number
+ *
+ * @param det Detector number
+ * @return DDL number
+ */
UShort_t Detector2DDL(UShort_t det) const { return det - 1; }
- /** Return board address corresponding to a sector
- @param ring Ring identifier
- @param sec Sector number
- @return The board number, or negative number in case of failure */
+ /**
+ * Return board address corresponding to a sector
+ *
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @return The board number, or negative number in case of failure
+ */
Short_t Sector2Board(Char_t ring, UShort_t sec) const;
- /** Convert strip address to a channel address.
- @param ring Ring identifier
- @param sec Sector number
- @param str Strip number
- @param board On return, contains the board number
- @param altro On return, contains the altro number
- @param chan On return, contains the channel number
- @return @c true on success. */
+ /**
+ * Convert strip address to a channel address.
+ *
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @param str Strip number
+ * @param board On return, contains the board number
+ * @param altro On return, contains the altro number
+ * @param chan On return, contains the channel number
+ * @return @c true on success.
+ */
Bool_t Strip2Channel(Char_t ring, UShort_t sec,
UShort_t str, UShort_t& board,
UShort_t& altro, UShort_t& chan) const;
- /** Get the timebin correspoding to a strip and sample
- @param sec Sector number
- @param str Strip number
- @param sam Sample number
- @param preSamples Number of pre-samples.
- @param sampleRate The over-sampling rate
- @return the timebin corresponding to the passed strip */
+ /**
+ * Get the timebin correspoding to a strip and sample
+ *
+ * @param sec Sector number
+ * @param str Strip number
+ * @param sam Sample number
+ * @param preSamples Number of pre-samples.
+ * @param sampleRate The over-sampling rate
+ * @return the timebin corresponding to the passed strip
+ */
UShort_t Strip2Timebin(UShort_t sec, UShort_t strip,
UShort_t sam, UShort_t preSamples,
UShort_t sampleRate) const;
- /** Map a detector index into a hardware address.
- @param det The detector #
- @param ring The ring ID
- @param sec The sector #
- @param str The strip #
- @param sam The sample number
- @param preSamples Number of pre-samples
- @param sampleRate The oversampling rate
- @param ddl On return, hardware DDL number
- @param board On return, the FEC board address (local to DDL)
- @param altro On return, the ALTRO number (local to FEC)
- @param channel On return, the channel number (local to ALTRO)
- @param timebin On return, the timebin number (local to ALTRO)
- @return @c true on success, false otherwise */
+ /**
+ * Map a detector index into a hardware address.
+ *
+ * @param det The detector #
+ * @param ring The ring ID
+ * @param sec The sector #
+ * @param str The strip #
+ * @param sam The sample number
+ * @param preSamples Number of pre-samples
+ * @param sampleRate The oversampling rate
+ * @param ddl On return, hardware DDL number
+ * @param board On return, the FEC board address (local to DDL)
+ * @param altro On return, the ALTRO number (local to FEC)
+ * @param channel On return, the channel number (local to ALTRO)
+ * @param timebin On return, the timebin number (local to ALTRO)
+ * @return @c true on success, false otherwise
+ */
Bool_t Detector2Hardware(UShort_t det, Char_t ring,
UShort_t sec, UShort_t str,
UShort_t sam,
UShort_t& ddl, UShort_t& board,
UShort_t& altro, UShort_t& channel,
UShort_t& timebin) const;
- /** Map a detector index into a hardware address.
- @param det The detector #
- @param ring The ring ID
- @param sec The sector #
- @param str The strip #
- @param sam The sample number
- @param preSamples Number of pre-samples
- @param sampleRate The oversampling rate
- @param ddl On return, hardware DDL number
- @param hwaddr On return, hardware address.
- @param timebin On return, the timebin number (local to ALTRO)
- @return @c true on success, false otherwise */
+ /**
+ * Map a detector index into a hardware address.
+ *
+ * @param det The detector #
+ * @param ring The ring ID
+ * @param sec The sector #
+ * @param str The strip #
+ * @param sam The sample number
+ * @param preSamples Number of pre-samples
+ * @param sampleRate The oversampling rate
+ * @param ddl On return, hardware DDL number
+ * @param hwaddr On return, hardware address.
+ * @param timebin On return, the timebin number (local to ALTRO)
+ * @return @c true on success, false otherwise
+ */
Bool_t Detector2Hardware(UShort_t det, Char_t ring,
UShort_t sec, UShort_t str,
UShort_t sam,
UShort_t preSamples, UShort_t sampleRate,
UShort_t& ddl, UShort_t& hwaddr,
UShort_t& timebin) const;
- /** Convert board, chip, channel to a hardware address
- @param board Board number
- @param altro Altro number
- @param channel Channel number
- @return hardware address of a channel */
+ /**
+ * Convert board, chip, channel to a hardware address
+ *
+ * @param board Board number
+ * @param altro Altro number
+ * @param channel Channel number
+ * @return hardware address of a channel
+ */
UInt_t ChannelAddress(UShort_t board, UShort_t altro, UShort_t channel) const;
- /** Convert a channel address to board, altro, channel fields
- @param hwaddr Channel address
- @param board On return, the Board number
- @param altro On return, the Altro number
- @param channel On return, the Channel number */
+ /**
+ * Convert a channel address to board, altro, channel fields
+ *
+ * @param hwaddr Channel address
+ * @param board On return, the Board number
+ * @param altro On return, the Altro number
+ * @param channel On return, the Channel number
+ */
void ChannelAddress(UShort_t hwaddr, UShort_t& board, UShort_t& altro,
UShort_t& channel) const;
- /** convert a partial detector index into a hardware address
- @param sector Sector number
- @param str Strip number
- @param ring Ring ID as an integer
- @return Hardware address */
+ /**
+ * convert a partial detector index into a hardware address
+ *
+ * @param sector Sector number
+ * @param str Strip number
+ * @param ring Ring ID as an integer
+ * @return Hardware address
+ */
Int_t GetHWAddress(Int_t sector, Int_t str, Int_t ring);
- /** Get the pad-row (or sector) corresponding to hardware address
- @param hwaddr hardware address
- @return Sector number */
+ /**
+ * Get the pad-row (or sector) corresponding to hardware address
+ *
+ * @param hwaddr hardware address
+ * @return Sector number
+ */
Int_t GetPadRow(Int_t hwaddr) const;
- /** Get the pad (or strip) corresponding to hardware address
- @param hwaddr hardware address
- @return Strip number */
+ /**
+ * Get the pad (or strip) corresponding to hardware address
+ *
+ * @param hwaddr hardware address
+ * @return Strip number
+ */
Int_t GetPad(Int_t hwaddr) const;
- /** Get the sector (or ring) corresponding to hardware address
- @param hwaddr hardware address
- @return Ring ID as an integer */
+ /**
+ * Get the sector (or ring) corresponding to hardware address
+ *
+ * @param hwaddr hardware address
+ * @return Ring ID as an integer
+ */
Int_t GetSector(Int_t hwaddr) const;
- /** Print map to standard out
- @param option Option string (hw, or det) */
+ /**
+ * Print map to standard out
+ *
+ * @param option Option string (hw, or det)
+ */
void Print(Option_t* option="hw") const;
protected:
- /** Read map from file - not used
- @return @c true on success */
+ /**
+ * Read map from file - not used
+ *
+ * @return @c true on success
+ */
virtual Bool_t ReadMapping();
- /** Create the inverse mapping arrays */
+ /**
+ * Create the inverse mapping arrays
+ */
virtual Bool_t CreateInvMapping();
ClassDef(AliFMDAltroMapping, 2) // Read raw FMD Altro data
+++ /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. *
- **************************************************************************/
-//____________________________________________________________________
-//
-// Utility class for analysing ESD data.
-// This class does sharing and background correction
-//
-#include <AliESDFMD.h>
-#include "AliFMDAnaESD.h"
-#include "AliFMDAnaRing.h"
-#include <TMath.h>
-#include <TBrowser.h>
-// clude <AliLog.h>
-
-//____________________________________________________________________
-AliFMDAnaESD::AliFMDAnaESD()
- : fNEvents(0)
-{
- // Constructor
- // Parameters:
- // lower cut.
- //
- AddLoad(kESD);
- for (size_t i = 0; i < 5; i++) fRing[i] = 0;
-}
-//____________________________________________________________________
-Bool_t
-AliFMDAnaESD::Init()
-{
- // Called at beginning of run
- // Parameters:
- // Return
- // @c false on error
- //
- for (int i = 0; i < 5; i++) if (fRing[i]) fRing[i]->Init();
- return AliFMDInput::Init();
-}
-//____________________________________________________________________
-Bool_t
-AliFMDAnaESD::Begin(Int_t ev)
-{
- // Begining of event
- // Parameters:
- // ev Event number
- // Return
- // @c false on error
- //
- fNEvents++;
- for (int i = 0; i < 5; i++) if (fRing[i]) fRing[i]->Begin();
- Bool_t ret = AliFMDInput::Begin(ev);
- return ret;
-}
-//____________________________________________________________________
-Bool_t
-AliFMDAnaESD::ProcessESDs()
-{
- // Loop over all ESD data, and call ProcessESD for each entry.
- // Parameters:
- // Return
- // @c false on error
- //
-
- // Process event summary data
- if (!fESD) return kFALSE;
- for (UShort_t det = 1; det <= 3; det++) {
- Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
- for (Char_t* rng = rings; *rng != '\0'; rng++) {
- UShort_t nsec = (*rng == 'I' ? 20 : 40);
- UShort_t nstr = (*rng == 'I' ? 512 : 256);
- Int_t ridx = FindRing(det, *rng);
- if (ridx < 0 || !fRing[ridx]) continue;
- for (UShort_t sec = 0; sec < nsec; sec++) {
- for (UShort_t str = 0; str < nstr; str++) {
- Float_t eta = fESD->Eta(det,*rng,sec,str);
- Float_t mult = fESD->Multiplicity(det,*rng,sec,str);
- Float_t multp1 = (str == nstr-1 ? 0 :
- fESD->Multiplicity(det,*rng,sec,str+1));
- if (!fESD->IsAngleCorrected()) {
- double c=TMath::Abs(TMath::Cos(2.*TMath::ATan(TMath::Exp(-eta))));
- mult *= c;
- multp1 *= c;
- }
-
- // Check signal isn't pedestal
- if (mult < 0.001) continue;
-
- // Phi
- Double_t dPhi = 2*TMath::Pi() / fRing[ridx]->NSeq();
- Double_t phi;
- if (det == 3) phi = TMath::Pi() - (sec + .5) * dPhi;
- else phi = (sec + .5) * dPhi;
- if (phi < 0) phi += 2 * TMath::Pi();
-
- if (fRing[ridx]->ProcessESD(phi, eta, mult, multp1)) str++;
- // "mult" possibly updated
- Fill(phi, eta, mult);
- }
- }
- }
- }
- return kTRUE;
-}
-//____________________________________________________________________
-Bool_t
-AliFMDAnaESD::End()
-{
- for (int i = 0; i < 5; i++) if (fRing[i]) fRing[i]->End();
- return AliFMDInput::End();
-}
-//____________________________________________________________________
-Bool_t
-AliFMDAnaESD::Finish()
-{
- // Called at the end of run
- // Parameters:
- // Return
- // @c false in case of errors
- //
- for (int i = 0; i < 5; i++) if (fRing[i]) fRing[i]->Finish();
- return AliFMDInput::Finish();
-}
-//__________________________________________________________________
-void
-AliFMDAnaESD::AddRing(AliFMDAnaRing* ring)
-{
- // Add a ring
- // Parameters:
- // ring Ring object
- //
- Int_t idx = FindRing(ring->Detector(),ring->Ring());
- if (idx < 0) return;
- fRing[idx] = ring;
-}
-//____________________________________________________________________
-Int_t
-AliFMDAnaESD::FindRing(UShort_t det, Char_t ring) const
-{
- // Find a ring index
- // Parameters:
- // det Detector number
- // ring Ring id
- // Return
- // Index of ring object
- //
- Int_t idx = -1;
- switch (det) {
- case 1: idx = 0; break;
- case 2: idx = 1 + (ring == 'O' || ring == 'o' ? 1 : 0); break;
- case 3: idx = 3 + (ring == 'O' || ring == 'o' ? 1 : 0); break;
- }
- return idx;
-}
-
-//____________________________________________________________________
-void
-AliFMDAnaESD::Browse(TBrowser* b)
-{
- for (size_t i = 0; i < 5; i++)
- if (fRing[i]) b->Add(fRing[i], fRing[i]->Name());
-}
-
-//____________________________________________________________________
-//
-// EOF
-//
+++ /dev/null
-// -*- mode: C++ -*-
-#ifndef ALIFMDANAESD_H
-#define ALIFMDANAESD_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
- */
-//____________________________________________________________________
-//
-// Utility class for analysing ESD data.
-// This class does sharing and background correction
-//
-#include <AliFMDInput.h>
-class AliFMDAnaRing;
-// #include "AliFMDAnaRing.h"
-class TBrowser;
-
-/** Base class for analysing FMD ESD data */
-class AliFMDAnaESD : public AliFMDInput
-{
-public:
- /** Constructor
- @param lower cut. */
- AliFMDAnaESD();
- /** Destructor */
- virtual ~AliFMDAnaESD() {}
- /** Called at beginning of run
- @return @c false on error */
- virtual Bool_t Init();
- /** Begining of event
- @param ev Event number
- @return @c false on error */
- virtual Bool_t Begin(Int_t ev);
- /** Loop over all ESD data, and call ProcessESD for each entry.
- @return @c false on error */
- virtual Bool_t ProcessESDs();
- /** Fill for analysis */
- virtual void Fill(Float_t /*phi*/, Float_t /*eta*/, Float_t /*mult*/) {}
- /** Called at the end of event
- @return @c false in case of errors */
- virtual Bool_t End();
- /** Called at the end of run
- @return @c false in case of errors */
- virtual Bool_t Finish();
- /** Browse this object */
- virtual void Browse(TBrowser* b);
- /** This is a folder */
- virtual Bool_t IsFolder() const { return kTRUE; }
-protected:
- AliFMDAnaESD(const AliFMDAnaESD& o)
- : AliFMDInput(o),
- fNEvents(o.fNEvents)
- {
- for (size_t i = 0; i < 4; i++) fRing[i] = o.fRing[i];
- }
- AliFMDAnaESD& operator=(const AliFMDAnaESD& o)
- {
- for (size_t i = 0; i < 4; i++) fRing[i] = o.fRing[i];
- fNEvents = o.fNEvents;
- return *this;
- }
- /** Add a ring
- @param ring Ring object */
- virtual void AddRing(AliFMDAnaRing* ring);
- /** Find a ring index
- @param det Detector number
- @param ring Ring id
- @return Index of ring object */
- virtual Int_t FindRing(UShort_t det, Char_t ring) const;
- /** Ring objects */
- AliFMDAnaRing* fRing[5];
- /** Number of events */
- ULong_t fNEvents;
- ClassDef(AliFMDAnaESD,0) // Base class for analysing FMD ESD
-};
-
-#endif
-//
-// EOF
-//
-
-
+++ /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. *
- **************************************************************************/
-//____________________________________________________________________
-//
-// Utility class for analysing ESD data.
-// This class does sharing and background correction
-// It can form a base class for other things too.
-// This line is here to make the silly code checker happy!
-// This line is here to make the silly code checker happy!
-//
-#include "AliFMDAnaRing.h"
-#include <TH2.h>
-#include <TMath.h>
-#include <TBrowser.h>
-// #include <AliLog.h>
-#define ne 80
-#define emin -3.7
-#define emax 5.3
-#define nm 100
-#define mmin -.5
-#define mmax 9.5
-// namespace {
-// Int_t ne = 80;
-// Float_t emin = -3.7;
-// Float_t emax = 5.3;
-// Int_t nm = 100;
-// Int_t mmin = -.5;
-// Int_t mmax = 9.5;
-// }
-
-//____________________________________________________________________
-AliFMDAnaRing::AliFMDAnaRing()
- : fDet(0),
- fRing('\0'),
- fBg(0),
- fCut0(0),
- fCut1(0),
- fUseBgCor(kFALSE),
- fNSeq(0),
- fBareMult(),
- fMergedMult(),
- fRemovedMult(),
- fMult(),
- fStep1(),
- fStep2(),
- fStep3(),
- fNEvents(0)
-{
- // Default constructor.
- // Do not use.
- // Used by ROOT I/O
- for (int i = 0; i < 6; i++) fName[i] = '\0';
-}
-
-//____________________________________________________________________
-AliFMDAnaRing::AliFMDAnaRing(UShort_t det, Char_t ring,
- TH2* bg, Float_t c0, Float_t c1)
- : fDet(det),
- fRing(ring),
- fBg(bg),
- fCut0(c0),
- fCut1(c1),
- fUseBgCor(bg ? kTRUE : kFALSE),
- fNSeq(ring == 'I' || ring == 'i' ? 20 : 40),
- fBareMult(Form("bareMult%d%c", fDet, fRing), "Bare multiplicity",
- ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
- fMergedMult(Form("mergedMult%d%c", fDet, fRing), "Merged multiplicity",
- ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
- fRemovedMult(Form("removedMult%d%c", fDet, fRing), "Removed multiplicity",
- ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
- fMult(Form("mult%d%c", fDet, fRing), "Multiplicity",
- ne, emin, emax, fNSeq, 0, 2*TMath::Pi()),
- fStep1(Form("step1_%d%c",fDet,fRing), "Step 1", nm,mmin,mmax,nm,mmin,mmax),
- fStep2(Form("step2_%d%c",fDet,fRing), "Step 2", nm,mmin,mmax,nm,mmin,mmax),
- fStep3(Form("step3_%d%c",fDet,fRing), "Step 3", nm,mmin,mmax,nm,mmin,mmax),
- fNEvents(0)
-{
- // Constructor
- //
- // Parameters
- // det Detector
- // ring Ring
- // bg Background
- // c0 Lower cut
- // c1 higher cut */
- fName[0] = 'F'; fName[1] = 'M'; fName[2] = 'D';
- fName[3] = Char_t(det+48); fName[4] = ring;
- fName[5] = '\0';
- fBareMult.SetDirectory(0);
- fBareMult.SetXTitle("#eta");
- fBareMult.SetYTitle("#varphi");
- fBareMult.SetZTitle("d^2M_{ch}'/d#etad#varphi");
- fMergedMult.SetDirectory(0);
- fMergedMult.SetXTitle("#eta");
- fMergedMult.SetYTitle("#varphi");
- fMergedMult.SetZTitle("d^2M_{ch}''/d#etad#varphi");
- fRemovedMult.SetDirectory(0);
- fRemovedMult.SetXTitle("#eta");
- fRemovedMult.SetYTitle("#varphi");
- fRemovedMult.SetZTitle("d^2M_{ch}'''/d#etad#varphi");
- fMult.SetDirectory(0);
- fMult.SetXTitle("#eta");
- fMult.SetYTitle("#varphi");
- fMult.SetZTitle("d^2M_{ch}/d#etad#varphi");
- fStep1.SetDirectory(0);
- fStep1.SetXTitle("Bare multiplicity");
- fStep1.SetYTitle("Merged multiplicity");
- fStep2.SetDirectory(0);
- fStep2.SetXTitle("Merged multiplicity");
- fStep2.SetYTitle("Cut multiplicity");
- fStep3.SetDirectory(0);
- fStep3.SetXTitle("Cut multiplicity");
- fStep3.SetYTitle("Multiplicity");
-}
-
-//____________________________________________________________________
-AliFMDAnaRing::AliFMDAnaRing(const AliFMDAnaRing& o)
- : TObject(o),
- fDet(o.fDet),
- fRing(o.fRing),
- fBg(o.fBg),
- fCut0(o.fCut0),
- fCut1(o.fCut1),
- fUseBgCor(o.fUseBgCor),
- fNSeq(o.fNSeq),
- fBareMult(o.fBareMult),
- fMergedMult(o.fMergedMult),
- fRemovedMult(o.fRemovedMult),
- fMult(o.fMult),
- fStep1(o.fStep1),
- fStep2(o.fStep2),
- fStep3(o.fStep3),
- fNEvents(o.fNEvents)
-{
- // Copy constructor.
- // Do not use.
- // Used by ROOT I/O
- fBareMult.SetDirectory(0);
- fBareMult.SetXTitle("#eta");
- fBareMult.SetYTitle("#varphi");
- fBareMult.SetZTitle("dM_{ch}'/d#eta");
- fMergedMult.SetDirectory(0);
- fMergedMult.SetXTitle("#eta");
- fMergedMult.SetYTitle("#varphi");
- fMergedMult.SetZTitle("dM_{ch}''/d#eta");
- fRemovedMult.SetDirectory(0);
- fRemovedMult.SetXTitle("#eta");
- fRemovedMult.SetYTitle("#varphi");
- fRemovedMult.SetZTitle("dM_{ch}'''/d#eta");
- fMult.SetDirectory(0);
- fMult.SetXTitle("#eta");
- fMult.SetYTitle("#varphi");
- fMult.SetZTitle("dM_{ch}/d#eta");
- for (int i = 0; i < 6; i++) fName[i] = o.fName[i];
-}
-
-//____________________________________________________________________
-AliFMDAnaRing&
-AliFMDAnaRing::operator=(const AliFMDAnaRing& o)
-{
- // Assignment operator
- //
- // Parameters:
- // o Object to assign from
- // Returns:
- // Reference to this object.
- this->fDet = o.fDet;
- this->fRing = o.fRing;
- this->fBg = o.fBg;
- this->fCut0 = o.fCut0;
- this->fCut1 = o.fCut1;
- this->fUseBgCor = o.fUseBgCor;
- this->fNSeq = o.fNSeq;
- fBareMult.Reset(); fBareMult.Add(&o.fBareMult);
- fMergedMult.Reset(); fMergedMult.Add(&o.fMergedMult);
- fRemovedMult.Reset(); fRemovedMult.Add(&o.fRemovedMult);
- fMult.Reset(); fMult.Add(&o.fMult);
- return *this;
-}
-
-
-//____________________________________________________________________
-Bool_t
-AliFMDAnaRing::ProcessESD(Float_t phi, Float_t eta, Float_t& m1, Float_t m2)
-{
- // Process ESD
- // Parameters
- // phi Azimuthal angle @f$ \varphi @f$ of the hit
- // eta Psuedo-rapidity @f$ \eta@f$ of hit
- // m1 Multiplicity of this strip. C ontains the corrected
- // value on return
- // m2 Multiplicity of neighbor strip
- // Return
- // true if hits are merged */
-
- // Merge shared hits
- Bool_t merged = false;
- Float_t sig = m1;
- fBareMult.Fill(eta, phi, m1);
- if ((m1 < fCut0 || m2 < fCut0) && m2 > 0.001) {
- sig = m1 + m2;
- merged = true;
- fRemovedMult.Fill(eta, phi, TMath::Min(m1,m2));
- }
- fMergedMult.Fill(eta, phi, sig);
- fStep1.Fill(m1, sig);
-
- // Real multiplicity
- Double_t cmult = 1;
- if (sig < fCut0 / 2) cmult = 0; // return merged; // cmult = 0;
- if (sig > fCut1) cmult = 2;
- fStep2.Fill(sig, cmult);
-
- // Background correction
- Float_t bmult = cmult;
- if (fUseBgCor && fBg) {
- // Float_t bgPhi = phi + (phi > TMath::Pi() ? -2*TMath::Pi() : 0);
- Float_t bgPhi = phi - TMath::Pi();
- Int_t bgBin = fBg->FindBin(eta, bgPhi);
- Float_t bgCor = (bgBin > 0 ? fBg->GetBinContent(bgBin) : 0);
- bmult = (bgCor < 0.01 ? 0 : cmult / bgCor);
- }
- fStep3.Fill(cmult, bmult);
- fMult.Fill(eta, phi, bmult);
-
- // Call user code
- Fill(phi, eta, bmult);
- m1 = bmult;
-
- return merged;
-}
-//____________________________________________________________________
-void
-AliFMDAnaRing::Finish()
-{
- // Finish this task
- //
- // Parameters:
- // none
- // Returns:
- // nothing
- Double_t de = (fMult.GetXaxis()->GetXmax() -
- fMult.GetXaxis()->GetXmin())/fMult.GetNbinsX();
- Double_t dp = 2*TMath::Pi() / fNSeq;
- Double_t scale = ((fNEvents == 0 ? 1. : 1. / fNEvents) * 1 / de * 1 / dp);
- fBareMult.Scale(scale);
- fMergedMult.Scale(scale);
- fRemovedMult.Scale(scale);
- fMult.Scale(scale);
-}
-//____________________________________________________________________
-Int_t
-AliFMDAnaRing::Color() const
-{
- // Get the ring specific color
- //
- // Returns:
- // The color of the current ring
- switch (fDet) {
- case 1: return kGreen + 2;
- case 2: return kRed + (fRing == 'I' || fRing == 'i' ? 2 : -7);
- case 3: return kBlue + (fRing == 'I' || fRing == 'i' ? 2 : -7);
- }
- return 0;
-}
-//____________________________________________________________________
-void
-AliFMDAnaRing::Browse(TBrowser* b)
-{
- // Browse this object
- //
- // Parameters:
- // b Browser to use
- // Returns:
- // nothing
- b->Add(&fBareMult);
- b->Add(&fMergedMult);
- b->Add(&fRemovedMult);
- b->Add(&fMult);
- b->Add(&fStep1);
- b->Add(&fStep2);
- b->Add(&fStep3);
- if (fBg) b->Add(fBg);
-}
-
-//____________________________________________________________________
-//
-// EOF
-//
-
+++ /dev/null
-// -*- mode: c++ -*-
-#ifndef ALIFMDANARING_H
-#define ALIFMDANARING_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
- */
-//____________________________________________________________________
-//
-// Utility class for analysing ESD data.
-// This class does sharing and background correction.
-// It can form a base class for other things too.
-//
-#include <TObject.h>
-#include <TH2D.h>
-class TBrowser;
-
-/** Base class for analysing FMD ESD data */
-class AliFMDAnaRing : public TObject
-{
-public:
- /** Constructor */
- AliFMDAnaRing();
- /** Constructor
- @param det Detector
- @param ring Ring
- @param bg Background - not owned
- @param c0 Lower cut
- @param c1 higher cut */
- AliFMDAnaRing(UShort_t det, Char_t ring, TH2* bg, Float_t c0, Float_t c1);
- /** Destructor */
- virtual ~AliFMDAnaRing() {}
- /** Called at beginning of run */
- virtual void Init() { fNEvents = 0; }
- /** Called at beginning of event */
- virtual void Begin() { fNEvents++; }
- /** Process ESD
- @param phi Azimuthal angle @f$ \varphi @f$ of the hit (radians)
- @param eta Psuedo-rapidity @f$ \eta@f$ of hit
- @param m1 Multiplicity of this strip
- @param m2 Multiplicity of neighbor strip
- @return @c true if hits are merged */
- virtual Bool_t ProcessESD(Float_t phi, Float_t eta, Float_t& m1, Float_t m2);
- /** User defined member function.
- @param phi Azimuthal angle @f$ \varphi @f$ of the hit (radians)
- @param eta Psuedo-rapidity @f$ \eta@f$ of hit
- @param mult Corrected multiplicity */
- virtual void Fill(Float_t phi, Float_t eta, Float_t mult) = 0;
- /** Called at end of event */
- virtual void End() {}
- /** Called at end of run */
- virtual void Finish();
- /** Get the detector identifier
- @return Detector identifier */
- UShort_t Detector() const { return fDet; }
- /** Get the ring identifier
- @return Ring identifier */
- Char_t Ring() const { return fRing; }
- /** Get the number of seqments */
- UShort_t NSeq() const { return fNSeq; }
- /** Get the name
- @return static string */
- const Char_t* Name() const { return fName; }
- /** Get the ring color
- @return color */
- Int_t Color() const;
- /** Browse this object */
- virtual void Browse(TBrowser* b);
- /** This is a folder */
- virtual Bool_t IsFolder() const { return kTRUE; }
-protected:
- /** Hidden copy constructor */
- AliFMDAnaRing(const AliFMDAnaRing&);
- /** Hidden Assignement operator */
- AliFMDAnaRing& operator=(const AliFMDAnaRing&);
- /** Detector number */
- UShort_t fDet; // Detector number
- /** Ring identifier */
- Char_t fRing; // Ring identifier
- /** Name */
- Char_t fName[6]; // Name
- /** Background correction */
- TH2* fBg; // Background correction
- /** Lower cut */
- Float_t fCut0; // Lower cut
- /** Higher cut */
- Float_t fCut1; // Higher cut
- /** Whether to use bacground correction */
- Bool_t fUseBgCor; // Whether to use bacground correction
- /** # of segments */
- Int_t fNSeq; // # of segments
- /** Histogram of multiplicity before any cuts */
- TH2D fBareMult; // Bare multiplicity
- /** Histogram of multiplicity after merging */
- TH2D fMergedMult; // Multiplicity after merging shared hits
- /** Histogram of removed multiplicity */
- TH2D fRemovedMult;// Merged hits
- /** Histogram of background corrected */
- TH2D fMult; // The multiplicity
- /** Step histogram 1 */
- TH2D fStep1; // Diagnostics step 1
- /** Step histogram 1 */
- TH2D fStep2; // Diagnostics step 2
- /** Step histogram 1 */
- TH2D fStep3; // Diagnostics step 3
-
- /** Event counter */
- Int_t fNEvents; // Event counter
- ClassDef(AliFMDAnaRing,1) // Analysis of ESD in a ring
-};
-
-
-#endif
-//
-// 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. *
- **************************************************************************/
-
-// Thil class computes background corrections for the FMD. The
-// correction is computed in eta,phi cells and the objects stored can
-// be put into alien to use with analysis. It is based on the
-// AliFMDInput class that is used to loop over hits and primaries.
-//
-// Author: Hans Hjersing Dalsgaard, NBI, hans.dalsgaard@cern.ch
-//
-//
-
-#include "AliSimulation.h"
-#include "TStopwatch.h"
-#include "iostream"
-#include "TGrid.h"
-#include "AliRunLoader.h"
-#include "AliGeomManager.h"
-#include "AliFMDGeometry.h"
-#include "AliStack.h"
-#include "TParticle.h"
-#include "TDatabasePDG.h"
-#include "TParticlePDG.h"
-#include "AliRun.h"
-#include "AliFMDBackgroundCorrection.h"
-#include "TSystem.h"
-#include "AliCDBManager.h"
-#include "TTree.h"
-#include "TClonesArray.h"
-#include "TBranch.h"
-#include "AliFMDHit.h"
-#include "AliLoader.h"
-#include "AliFMD.h"
-#include "AliGenEventHeader.h"
-#include "AliHeader.h"
-#include "TFile.h"
-#include "TAxis.h"
-#include "AliCDBId.h"
-#include "AliCDBMetaData.h"
-#include "TROOT.h"
-#include "AliFMDParameters.h"
-#include "AliLog.h"
-#include "TList.h"
-#include "AliFMDAnaParameters.h"
-#include "AliFMDAnaCalibBackgroundCorrection.h"
-#include "AliTrackReference.h"
-#include "AliFMDStripIndex.h"
-
-ClassImp(AliFMDBackgroundCorrection)
-//_____________________________________________________________________
-AliFMDBackgroundCorrection::AliFMDBackgroundCorrection() :
- TNamed(),
- fCorrectionArray(),
- fPrimaryList()
-{}
-
-//_____________________________________________________________________
-AliFMDBackgroundCorrection::AliFMDInputBG::AliFMDInputBG(Bool_t hits_not_trackref)
- : AliFMDInput("galice.root"),
- fPrimaryArray(),
- fHitArray(),
- fPrimaryMapInner(),
- fPrimaryMapOuter(),
- fHitMap(0), // nDetector=0 means 51200 slots
- fLastTrackByStrip(0), // nDetector=0 means 51200 slots
- fPrim(0),
- fHits(0),
- fZvtxCut(0),
- fNvtxBins(0),
- fPrevTrack(-1),
- fPrevDetector(-1),
- fPrevRing('Q'),
- fPrevSec(-1),
- fNbinsEta(100)
-{
- if(hits_not_trackref) {
- AddLoad(kHits);
- AddLoad(kTracks);
- }
- else
- AddLoad(kTrackRefs);
- AddLoad(kKinematics);
- AddLoad(kHeader);
-}
-
-//_____________________________________________________________________
-
-void
-AliFMDBackgroundCorrection::GenerateBackgroundCorrection(Bool_t from_hits,
- const Int_t nvtxbins,
- Float_t zvtxcut,
- const Int_t nBinsEta,
- Bool_t storeInAlien,
- Int_t runNo,
- Int_t endRunNo,
- const Char_t* filename,
- Bool_t simulate,
- Int_t nEvents,
- Bool_t inFile,
- const Char_t* infilename)
-{
- //TGrid::Connect("alien:",0,0,"t");
- if(simulate)
- Simulate(nEvents);
- else {
- //AliCDBManager::Instance()->SetDefaultStorage("alien://Folder=/alice/data/2008/LHC08d/OCDB/");
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
- AliCDBManager::Instance()->SetRun(runNo);
-
-#if defined(__CINT__)
- gSystem->Load("liblhapdf");
- gSystem->Load("libEGPythia6");
- gSystem->Load("libpythia6");
- gSystem->Load("libAliPythia6");
- gSystem->Load("libgeant321");
-#endif
- //
- }
-
- //Setting up the geometry
- //-----------------------------------------------
- if (AliGeomManager::GetGeometry() == NULL)
- AliGeomManager::LoadGeometry();
-
- AliFMDGeometry* geo = AliFMDGeometry::Instance();
- geo->Init();
- geo->InitTransformations();
-
- AliInfo("Processing hits and primaries ");
-
- AliFMDInputBG input(from_hits);
-
- if(!inFile) {
-
- input.SetVtxCutZ(zvtxcut);
- input.SetNvtxBins(nvtxbins);
- input.SetNbinsEta(nBinsEta);
- input.Run();
- }
-
- AliInfo(Form("Found %d primaries and %d hits.",
- input.GetNprim(),input.GetNhits()));
- TObjArray* hitArray ;
- TObjArray* primaryArray;
- if(inFile) {
- TFile* infile = TFile::Open(infilename);
- hitArray = new TObjArray();
- primaryArray = new TObjArray();
-
- for(Int_t det =1; det<=3;det++) {
- TObjArray* detArrayHits = new TObjArray();
- detArrayHits->SetName(Form("FMD%d",det));
- hitArray->AddAtAndExpand(detArrayHits,det);
- Int_t nRings = (det==1 ? 1 : 2);
- for(Int_t ring = 0;ring<nRings;ring++) {
- Char_t ringChar = (ring == 0 ? 'I' : 'O');
- TObjArray* vtxArrayHits = new TObjArray();
- vtxArrayHits->SetName(Form("FMD%d%c",det,ringChar));
- detArrayHits->AddAtAndExpand(vtxArrayHits,ring);
- for(Int_t v=0; v<nvtxbins;v++) {
-
- TH2F* hHits =
- static_cast<TH2F*>(infile->Get(Form("hHits_FMD%d%c_vtx%d",
- det,ringChar,v)));
-
-
- vtxArrayHits->AddAtAndExpand(hHits,v);
-
- }
- }
- }
-
- for(Int_t iring = 0; iring<2;iring++) {
- Char_t ringChar = (iring == 0 ? 'I' : 'O');
- TObjArray* ringArray = new TObjArray();
- ringArray->SetName(Form("FMD_%c",ringChar));
- primaryArray->AddAtAndExpand(ringArray,iring);
- for(Int_t v=0; v<nvtxbins;v++) {
-
- TH2F* hPrimary =
- static_cast<TH2F*>(infile->Get(Form("hPrimary_FMD_%c_vtx%d",
- ringChar,v)));
- ringArray->AddAtAndExpand(hPrimary,v);
- }
- }
-
-
- }
- else {
- hitArray = input.GetHits();
- primaryArray = input.GetPrimaries();
- }
- fCorrectionArray.SetName("FMD_bg_correction");
- fCorrectionArray.SetOwner();
-
- TList* primaryList = new TList();
- primaryList->SetName("primaries");
-
- TList* hitList = new TList();
- hitList->SetName("hits");
- TList* corrList = new TList();
- corrList->SetName("corrections");
-
- AliFMDAnaCalibBackgroundCorrection* background =
- new AliFMDAnaCalibBackgroundCorrection();
-
- for(Int_t det= 1; det <=3; det++) {
- Int_t nRings = (det==1 ? 1 : 2);
-
- TObjArray* detArrayCorrection = new TObjArray();
- detArrayCorrection->SetName(Form("FMD%d",det));
- fCorrectionArray.AddAtAndExpand(detArrayCorrection,det);
-
-
- for(Int_t iring = 0; iring<nRings; iring++) {
- TObjArray* primRingArray =
- static_cast<TObjArray*>(primaryArray->At(iring));
- Char_t ringChar = (iring == 0 ? 'I' : 'O');
- TObjArray* vtxArrayCorrection = new TObjArray();
- vtxArrayCorrection->SetName(Form("FMD%d%c",det,ringChar));
- detArrayCorrection->AddAtAndExpand(vtxArrayCorrection,iring);
-
- for(Int_t vertexBin=0;vertexBin<nvtxbins;vertexBin++) {
- TObjArray* detArray = (TObjArray*)hitArray->At(det);
- TObjArray* vtxArray = (TObjArray*)detArray->At(iring);
- TH2F* hHits = (TH2F*)vtxArray->At(vertexBin);
- hitList->Add(hHits);
- TH2F* hPrimary = static_cast<TH2F*>(primRingArray->At(vertexBin));
- primaryList->Add(hPrimary);
- TH2F* hCorrection =
- static_cast<TH2F*>(hHits->Clone(Form("FMD%d%c_vtxbin_%d_correction",
- det,ringChar,vertexBin)));
- hCorrection->Divide(hPrimary);
- corrList->Add(hCorrection);
- hCorrection->SetTitle(hCorrection->GetName());
- vtxArrayCorrection->AddAtAndExpand(hCorrection,vertexBin);
- background->SetBgCorrection(det,ringChar,vertexBin,hCorrection);
- }
- }
- }
-
- TAxis refAxis(nvtxbins,-1*zvtxcut,zvtxcut);
- if(inFile) {
- TFile* infile = TFile::Open(infilename);
- TAxis* refaxis = (TAxis*)infile->Get("vertexbins");
- background->SetRefAxis(refaxis);
-
- }
- else background->SetRefAxis(&refAxis);
-
- TFile* fout = new TFile(filename,"RECREATE");
- refAxis.Write("vertexbins");
-
- hitList->Write();
- primaryList->Write();
- corrList->Write();
-
- TObjArray* container = new TObjArray();
- container->SetOwner();
- container->AddAtAndExpand(&refAxis,0);
- container->AddAtAndExpand(&fCorrectionArray,1);
- container->AddAtAndExpand(hitArray,2);
- container->AddAtAndExpand(primaryArray,3);
-
-
- if(storeInAlien) {
- AliCDBManager* cdb = AliCDBManager::Instance();
- cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
- AliCDBId id(AliFMDAnaParameters::GetBackgroundPath(),runNo,endRunNo);
-
- AliCDBMetaData* meta = new AliCDBMetaData;
- meta->SetResponsible(gSystem->GetUserInfo()->fRealName.Data());
- meta->SetAliRootVersion(gROOT->GetVersion());
- meta->SetBeamPeriod(1);
- meta->SetComment("Background Correction for FMD");
- meta->SetProperty("key1", background );
- cdb->Put(background, id, meta);
-
- }
-
- fout->Close();
-
-
- }
-
-//_____________________________________________________________________
-void AliFMDBackgroundCorrection::Simulate(Int_t nEvents) {
-
- AliSimulation sim ;
- sim.SetRunNumber(0);
- TGrid::Connect("alien:",0,0,"t");
- // FIXME: Do not use a hard-coded path!
- sim.SetDefaultStorage("alien://Folder=/alice/data/2008/LHC08d/OCDB/");
- sim.SetConfigFile("Config.C");
- sim.SetRunQA("FMD:");
- TStopwatch timer;
- timer.Start();
- sim.RunSimulation(nEvents);
- timer.Stop();
- timer.Print();
-
-}
-
-//_____________________________________________________________________
-Bool_t
-AliFMDBackgroundCorrection::AliFMDInputBG::ProcessHit(AliFMDHit* h,
- TParticle* /*p*/)
-{
-
- if(!h)
- return kTRUE;
- Bool_t retval = ProcessEvent(h->Detector(),
- h->Ring(),
- h->Sector(),
- h->Strip(),
- h->Track(),
- h->Q());
-
- // std::cout<<"Length: "<<h->Length()<<std::endl;
- // std::cout<<"Is stopped "<<h->IsStop()<<" "<<kTRUE<<std::endl;
- return retval;
-}
-//_____________________________________________________________________
-Bool_t
-AliFMDBackgroundCorrection::AliFMDInputBG::ProcessTrackRef(AliTrackReference* tr, TParticle* p)
-{
- if(!tr)
- return kTRUE;
- UShort_t det,sec,strip;
- Char_t ring;
- AliFMDStripIndex::Unpack(tr->UserId(),det,ring,sec,strip);
- Int_t nTrack = tr->GetTrack();
- TDatabasePDG* pdgDB = TDatabasePDG::Instance();
- TParticlePDG* pdgPart = pdgDB->GetParticle(p->GetPdgCode());
- Float_t charge = (pdgPart ? pdgPart->Charge() : 0);
- Bool_t retval = ProcessEvent(det,ring,sec,strip,nTrack,charge);
- return retval;
-
-}
-//_____________________________________________________________________
-Bool_t
-AliFMDBackgroundCorrection::AliFMDInputBG::ProcessEvent(UShort_t det,
- Char_t ring,
- UShort_t sec,
- UShort_t strip,
- Int_t nTrack,
- Float_t charge)
-{
-
- if (charge == 0) return kTRUE;
-
- /* if(charge != 0 &&
- ((nTrack != fPrevTrack) ||
- (det != fPrevDetector))){ ||
- (ring != fPrevRing))){ ||
- (sec != fPrevSec))) {*/
- /*Float_t nstrips = (ring =='O' ? 256 : 512);
-
-
- Float_t prevStripTrack = -1;
- if(strip >0)
- prevStripTrack = fLastTrackByStrip.operator()(det,ring,sec,strip-1);
-
- Float_t nextStripTrack = -1;
- if(strip < (nstrips - 1))
- nextStripTrack = fLastTrackByStrip.operator()(det,ring,sec,strip+1);
- */
-
- Float_t thisStripTrack = fLastTrackByStrip(det,ring,sec,strip);
- // if(nTrack == fLastTrackByStrip.operator()(det,ring,sec,strip))
- // std::cout<<"Track # "<<nTrack<<" failed the cut in "<<det<<" "<<ring<<" "<<sec<<" "<<strip<<std::endl;
- // else
- // std::cout<<"Track # "<<nTrack<<" passed the cut in "<<det<<" "<<ring<<" "<<sec<<" "<<strip<<std::endl;
- if(nTrack == thisStripTrack) return kTRUE;
-
- fHitMap(det,ring,sec,strip) += 1;
- fHits++;
- Float_t nstrips = (ring =='O' ? 256 : 512);
- fLastTrackByStrip(det,ring,sec,strip) = Float_t(nTrack);
- if(strip >0)
- fLastTrackByStrip(det,ring,sec,strip-1) = Float_t(nTrack);
- if(strip < (nstrips - 1))
- fLastTrackByStrip(det,ring,sec,strip+1) = Float_t(nTrack);
-
- fPrevDetector = det;
- fPrevRing = ring;
- fPrevSec = sec;
- fPrevTrack = nTrack;
-
- return kTRUE;
-
-}
-
-//_____________________________________________________________________
-Bool_t AliFMDBackgroundCorrection::AliFMDInputBG::Init()
-{
- fLastTrackByStrip.Reset(-1);
-
- fPrimaryArray.SetOwner();
- fPrimaryArray.SetName("FMD_primary");
-
- fPrimaryMapInner.SetBins(fNbinsEta, -6,6, 20, 0, 2*TMath::Pi());
- fPrimaryMapOuter.SetBins(fNbinsEta, -6,6, 40, 0, 2*TMath::Pi());
- fPrimaryMapInner.SetName("fPrimaryMapInner");
- fPrimaryMapInner.SetName("fPrimaryMapOuter");
-
- fPrimaryMapInner.Sumw2();
- fPrimaryMapOuter.Sumw2();
- for(Int_t iring = 0; iring<2;iring++) {
- Char_t ringChar = (iring == 0 ? 'I' : 'O');
- TObjArray* ringArray = new TObjArray();
- ringArray->SetName(Form("FMD_%c",ringChar));
- fPrimaryArray.AddAtAndExpand(ringArray,iring);
- Int_t nSec = (iring == 1 ? 40 : 20);
- for(Int_t v=0; v<fNvtxBins;v++) {
-
- TH2F* hPrimary = new TH2F(Form("hPrimary_FMD_%c_vtx%d",ringChar,v),
- Form("hPrimary_FMD_%c_vtx%d",ringChar,v),
- fNbinsEta, -6,6, nSec, 0,2*TMath::Pi());
- hPrimary->Sumw2();
- ringArray->AddAtAndExpand(hPrimary,v);
- }
- }
-
-
- fHitArray.SetOwner();
- fHitArray.SetName("FMD_hits");
-
- for(Int_t det =1; det<=3;det++) {
- TObjArray* detArrayHits = new TObjArray();
- detArrayHits->SetName(Form("FMD%d",det));
- fHitArray.AddAtAndExpand(detArrayHits,det);
- Int_t nRings = (det==1 ? 1 : 2);
- for(Int_t ring = 0;ring<nRings;ring++) {
- Int_t nSec = (ring == 1 ? 40 : 20);
- Char_t ringChar = (ring == 0 ? 'I' : 'O');
- TObjArray* vtxArrayHits = new TObjArray();
- vtxArrayHits->SetName(Form("FMD%d%c",det,ringChar));
- detArrayHits->AddAtAndExpand(vtxArrayHits,ring);
- for(Int_t v=0; v<fNvtxBins;v++) {
- TH2F* hHits = new TH2F(Form("hHits_FMD%d%c_vtx%d", det,ringChar,v),
- Form("hHits_FMD%d%c_vtx%d", det,ringChar,v),
- fNbinsEta, -6,6, nSec, 0, 2*TMath::Pi());
- hHits->Sumw2();
- vtxArrayHits->AddAtAndExpand(hHits,v);
-
- }
- }
- }
-
- AliFMDInput::Init();
-
- return kTRUE;
-}
-//_____________________________________________________________________
-
-Bool_t AliFMDBackgroundCorrection::AliFMDInputBG::Begin(Int_t event )
-{
-
- Bool_t retVal = AliFMDInput::Begin(event);
- AliStack* partStack = fLoader->Stack();
- Int_t nTracks = partStack->GetNtrack();
-
-
- for(Int_t j=0;j<nTracks;j++) {
- TParticle* p = partStack->Particle(j);
- TDatabasePDG* pdgDB = TDatabasePDG::Instance();
- TParticlePDG* pdgPart = pdgDB->GetParticle(p->GetPdgCode());
- Float_t charge = (pdgPart ? pdgPart->Charge() : 0);
- if (charge == 0) continue;
-
- Float_t phi = TMath::ATan2(p->Py(),p->Px());
- if(phi<0) phi = phi+2*TMath::Pi();
- Float_t eta = p->Eta();
-
- // std::cout<<-1*TMath::Log(TMath::Tan(0.5*p->Theta()))<<std::endl;
-
- Bool_t primary = partStack->IsPhysicalPrimary(j);
- //(charge!=0)&&(TMath::Abs(p->Vx() - vertex.At(0))<0.01)&&(TMath::Abs(p->Vy() - vertex.At(1))<0.01)&&(TMath::Abs(p->Vz() - vertex.At(2))<0.01);
- if(!primary) continue;
-
- fPrim++;
-
- fPrimaryMapInner.Fill(eta,phi);
- fPrimaryMapOuter.Fill(eta,phi);
- }
-
- return retVal;
-}
-//_____________________________________________________________________
-Bool_t AliFMDBackgroundCorrection::AliFMDInputBG::End() {
-
- Bool_t retval = AliFMDInput::End();
-
- AliGenEventHeader* genHeader = fLoader->GetHeader()->GenEventHeader();
- TArrayF vertex;
- genHeader->PrimaryVertex(vertex);
-
- if(TMath::Abs(vertex.At(2)) > fZvtxCut)
- return kTRUE;
-
- Double_t delta = 2*fZvtxCut/fNvtxBins;
- Double_t vertexBinDouble = (vertex.At(2) + fZvtxCut) / delta;
- Int_t vertexBin = Int_t(vertexBinDouble);
- //Primaries
- TObjArray* innerArray = static_cast<TObjArray*>(fPrimaryArray.At(0));
- TObjArray* outerArray = static_cast<TObjArray*>(fPrimaryArray.At(1));
-
- TH2F* hPrimaryInner = static_cast<TH2F*>(innerArray->At(vertexBin));
- TH2F* hPrimaryOuter = static_cast<TH2F*>(outerArray->At(vertexBin));
-
- hPrimaryInner->Add(&fPrimaryMapInner);
- hPrimaryOuter->Add(&fPrimaryMapOuter);
-
- //Hits
- for(UShort_t det=1;det<=3;det++) {
- Int_t nRings = (det==1 ? 1 : 2);
- for (UShort_t ir = 0; ir < nRings; ir++) {
- Char_t ring = (ir == 0 ? 'I' : 'O');
- UShort_t nsec = (ir == 0 ? 20 : 40);
- UShort_t nstr = (ir == 0 ? 512 : 256);
-
- for(UShort_t sec =0; sec < nsec; sec++) {
-
- for(UShort_t strip = 0; strip < nstr; strip++) {
-
- if(fHitMap(det,ring,sec,strip) > 0) {
- //std::cout<<fHitMap.operator()(det,ring,sec,strip)<<std::endl;
- Double_t x,y,z;
- AliFMDGeometry* fmdgeo = AliFMDGeometry::Instance();
- fmdgeo->Detector2XYZ(det,ring,sec,strip,x,y,z);
-
- Int_t iring = (ring == 'I' ? 0 : 1);
-
- TObjArray* detArray = static_cast<TObjArray*>(fHitArray.At(det));
- TObjArray* vtxArray = static_cast<TObjArray*>(detArray->At(iring));
- TH2F* hHits = static_cast<TH2F*>(vtxArray->At(vertexBin));
-
- Float_t phi = TMath::ATan2(y,x);
- if(phi<0) phi = phi+2*TMath::Pi();
- Float_t r = TMath::Sqrt(TMath::Power(x,2)+TMath::Power(y,2));
- Float_t theta = TMath::ATan2(r,z-vertex.At(2));
- Float_t eta = -1*TMath::Log(TMath::Tan(0.5*theta));
- hHits->Fill(eta,phi,fHitMap.operator()(det,ring,sec,strip));
- }
-
- }
- }
- }
- }
-
- fPrimaryMapInner.Reset();
- fPrimaryMapOuter.Reset();
- fHitMap.Reset(0);
- fLastTrackByStrip.Reset(-1);
-
- return retval;
-}
-
-//
-// EOF
-//
-
-
+++ /dev/null
-// -*- mode: C++ -*-
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
- * reserved.
- *
- * See cxx source for full Copyright notice
- */
-// This class computes background corrections for the FMD. The
-// correction is computed in eta,phi cells and the objects stored can
-// be put into alien to use with analysis.
-//
-// Author: Hans Hjersing Dalsgaard, NBI, hans.dalsgaard@cern.ch
-//
-//
-
-#ifndef ALIFMDBACKGROUNDCORRECTION_H
-#define ALIFMDBACKGROUNDCORRECTION_H
-
-#include "AliFMDInput.h"
-#include <TObjArray.h>
-#include <AliRunLoader.h>
-#include <AliFMDFloatMap.h>
-#include <TH2F.h>
-class AliTrackReference;
-
-/**
- * Background correction map.
- *
- */
-class AliFMDBackgroundCorrection : public TNamed
-{
-public:
- /**
- * Constructor
- */
- AliFMDBackgroundCorrection() ;
- /**
- * Destructor
- */
- virtual ~AliFMDBackgroundCorrection() {};
- /**
- * Generate the background correction
- *
- * @param from_hits Whether we run over hits
- * @param nvtxbins Number of vertex bins
- * @param zvtxcut Outer cut on interaction point Z coordinate
- * @param nBinsEta Number of psuedo-rapidity bins
- * @param storeInAlien Whether to store the result in AliEn
- * @param runNo Run number
- * @param endRunNo End validity
- * @param filename The output file name
- * @param simulate Whether to run the simulation or not
- * @param nEvents Number of events to analyse
- * @param inFile Whether an input file is specified
- * @param infilename Input file name
- */
- void GenerateBackgroundCorrection(Bool_t from_hits = kFALSE,
- Int_t nvtxbins = 10,
- Float_t zvtxcut = 10,
- Int_t nBinsEta = 100,
- Bool_t storeInAlien = kFALSE,
- Int_t runNo = 0,
- Int_t endRunNo = 999999999,
- const Char_t* filename ="background.root",
- Bool_t simulate = kFALSE,
- Int_t nEvents = 10,
- Bool_t inFile = kFALSE,
- const Char_t* infilename="");
- /**
- * Nested class that derives from AliFMDInput to do the actual
- * processing
- */
- class AliFMDInputBG : public AliFMDInput
- {
-
- public :
- //AliFMDInputBG() ;
- /**
- * Constructo
- *
- * @param hits_not_trackrefs Use hits rather than track references
- */
- AliFMDInputBG(Bool_t hits_not_trackrefs);
- /**
- * Initialize the object
- *
- *
- * @return @c true on success.
- */
- Bool_t Init();
-
- /**
- * Get number of primaries seen
- *
- *
- * @return Number of primaries seen
- */
- Int_t GetNprim() {return fPrim;}
- /**
- * Get number of hits (total number of particles seen)
- *
- *
- * @return Total number of particles seen
- */
- Int_t GetNhits() {return fHits;}
- /**
- * Set the interaction point Z coordinate cut
- *
- * @param vtxCut The Z coordinate cut
- */
- void SetVtxCutZ(Double_t vtxCut) { fZvtxCut = vtxCut;}
- /**
- * Set the number of vertex bins
- *
- * @param nBins Number of vertex bins
- */
- void SetNvtxBins(Int_t nBins) { fNvtxBins = nBins;}
- /**
- * Set the number of eta bins
- *
- * @param nBins Number of eta bins
- */
- void SetNbinsEta(Int_t nBins) { fNbinsEta = nBins;}
- /**
- * Get a list of hits i.e., the particles that hit the FMD
- *
- * @return List of particles
- */
- TObjArray* GetHits() {return &fHitArray;}
- /**
- * Get a list of primaries i.e., the primary particles that hit the FMD
- *
- * @return List of particles
- */
- TObjArray* GetPrimaries() {return &fPrimaryArray;}
- /**
- * Get the run loader used
- *
- * @return Run loader used
- */
- AliRunLoader* GetRunLoader() {return fLoader; }
- private:
- /**
- * Process a single hit
- *
- * @param h Hit data
- * @param p Particle that made the hit
- *
- * @return @c false on failure
- */
- Bool_t ProcessHit(AliFMDHit* h, TParticle* p );
- /**
- * Process a track reference
- *
- * @param tr Track reference
- * @param p Particle that made the track reference
- *
- * @return @c false on failure
- */
- Bool_t ProcessTrackRef(AliTrackReference* tr, TParticle* p );
- /**
- * Process a single event
- *
- * @param det Detector
- * @param ring Ring
- * @param sector Sector
- * @param strip Strip
- * @param nTrack Track number
- * @param charge Charge
- *
- * @return @c false on failure
- */
- Bool_t ProcessEvent(UShort_t det,
- Char_t ring,
- UShort_t sector,
- UShort_t strip,
- Int_t nTrack,
- Float_t charge);
- /**
- * Called at start of event
- *
- * @param event Event number
- *
- * @return @c false on failure
- */
- Bool_t Begin(Int_t event );
- /**
- * Called at end of event
- *
- * @return @c false on failure
- */
- Bool_t End();
- TObjArray fPrimaryArray; // List of primaries
- TObjArray fHitArray; // List of all particles
- TH2F fPrimaryMapInner; // Histogram for inners
- TH2F fPrimaryMapOuter; // Histogram for outers
- // FIXME: Consider using AliFMDUShortMap, or maybe new class AliFMDIntMap
- AliFMDFloatMap fHitMap; // A map of hits
- AliFMDFloatMap fLastTrackByStrip; // A map of last track
- Int_t fPrim; // Number of primaries
- Int_t fHits; // Number of hits
- Double_t fZvtxCut; // Vertex cut
- Int_t fNvtxBins; // Number of vertex bins
- Int_t fPrevTrack; // Previous track number
- Int_t fPrevDetector; // Previous detector number
- Char_t fPrevRing; // Previous ring number
- Int_t fPrevSec; // Previous sector number
- Int_t fNbinsEta; // Number of eta bins
- };
-
-private:
- /**
- * Run a simulation
- *
- * @param e_t Not used
- */
- void Simulate(Int_t e);
- /**
- * Process all primaries from the run loader
- *
- * @param rl Run loader
- */
- void ProcessPrimaries(AliRunLoader* rl);
- TObjArray fCorrectionArray; // Array of corrections
- TList fPrimaryList; // List of primaries
- ClassDef(AliFMDBackgroundCorrection,0)
-
-};
-#endif
-// EOF
//
#include "AliFMDBaseDA.h"
-#include "iostream"
+#include "AliRawReader.h"
+#include "AliFMDDigit.h"
+#include "AliFMDParameters.h"
#include "AliFMDRawReader.h"
#include "AliFMDCalibSampleRate.h"
#include "AliFMDCalibStripRange.h"
#include "AliLog.h"
#include "AliRawEventHeaderBase.h"
+#include "AliFMDDigit.h"
+#include <TClonesArray.h>
+#include <TFile.h>
#include <TDatime.h>
#include <TSystem.h>
#include <TH2F.h>
-
+#include <iostream>
+#include <fstream>
//_____________________________________________________________________
ClassImp(AliFMDBaseDA)
#if 0
AliFMDBaseDA::MakeSummaryHistogram(const char* prefix, const char* title,
UShort_t d, Char_t r)
{
+ //
+ // Utility function for defining summary histograms
+ //
+ // Parameters:
+ // det Detector
+ // ring Ring identifier
+ // prefix Histogram prefix
+ // title Histogram title
+ //
Int_t nX = ((d == 1 || r == 'I' || r == 'i') ? 20 : 40);
Int_t nY = ((d == 1 || r == 'I' || r == 'i') ? 512 : 256);
#include "TNamed.h"
#include "TObjArray.h"
-#include "TClonesArray.h"
-#include "TFile.h"
-#include "iostream"
-#include "fstream"
#include "TString.h"
-#include "AliRawReader.h"
-#include "AliFMDDigit.h"
-#include "AliFMDParameters.h"
#include "TArrayS.h"
-class TDirectory;
+#include <iosfwd>
+#include <fstream>
+class AliFMDDigit;
+class AliRawReader;
+class AliFMDParameters;
class AliFMDRawReader;
+class TDirectory;
class TH2;
+class TFile;
+class TClonesArray;
class AliFMDBaseDA: public TNamed
{
* @param det Detector number to check
* @return true if the code has seen data from the detector
*/
- bool HasSeenDetector(UShort_t d) { return (d == 0 || d > 3) ? false : fSeenDetectors[d-1]; }
+ Bool_t HasSeenDetector(UShort_t d) const;
protected:
/**
* Initialize
- *
*/
virtual void Init() {};
/**
* Fill channels
- *
*/
virtual void FillChannels(AliFMDDigit* ) {};
/**
* Analyse a single strip result
- *
*/
virtual void Analyse(UShort_t, Char_t, UShort_t, UShort_t) {};
/**
* Write header to output file
- *
*/
virtual void WriteHeaderToFile() {};
/**
* Add a strip container
- *
*/
virtual void AddChannelContainer(TObjArray*, UShort_t, Char_t,
UShort_t, UShort_t ) {};
/**
* End of event
- *
*/
virtual void FinishEvent() {};
/**
* End of run
- *
*/
virtual void Terminate(TFile* ) {};
/**
* @param max Maximum number to keep (minus one for the current).
*/
void Rotate(const char* base, int max) const;
- static const UInt_t fgkBaseDDL = 3072; // base FMD ddl
- //Char_t* fDiagnosticsFilename;
- TString fDiagnosticsFilename; // name of diagnostics file
- std::ofstream fOutputFile; // output file
- std::ofstream fConditionsFile; // conditions file
- Bool_t fSaveHistograms; // save hists or not
- Bool_t fMakeSummaries; // save hists or not
- TObjArray fDetectorArray; // array indiced by detector
/**
* Ge the half-ring index
*
*/
const char* GetStripPath(UShort_t det, Char_t ring, UShort_t sec,
UShort_t str, Bool_t full=kTRUE) const;
-
-
-
- TArrayS fPulseSize; // Pulse size for gain calib
- TArrayS fPulseLength; // Pulse length for gain calib
-
- Bool_t fSeenDetectors[3]; // Detectors seen so far
-private:
/**
* Write conditions file
*
* @param dir Directory to make containers in
*/
void InitContainer(TDirectory* dir);
- Int_t fRequiredEvents; // number of events required for this calib
- Int_t fCurrentEvent; // the current event
-protected:
- UInt_t fRunno; // Current run number
/**
* Utility function for defining summary histograms
*
*/
TH2* MakeSummaryHistogram(const char* prefix, const char* title,
UShort_t det, Char_t ring);
+ /**
+ * Make a summary
+ *
+ */
virtual void MakeSummary(UShort_t, Char_t) { }
- TObjArray fSummaries;
+
+
+
+ static const UInt_t fgkBaseDDL = 3072; // base FMD ddl
+ //Char_t* fDiagnosticsFilename;
+ TString fDiagnosticsFilename; // name of diagnostics file
+ std::ofstream fOutputFile; // output file
+ std::ofstream fConditionsFile; // conditions file
+ Bool_t fSaveHistograms; // save hists or not
+ Bool_t fMakeSummaries; // save hists or not
+ TObjArray fDetectorArray; // array indiced by detector
+ TArrayS fPulseSize; // Pulse size for gain calib
+ TArrayS fPulseLength; // Pulse length for gain calib
+ Bool_t fSeenDetectors[3]; // Detectors seen so far
+ Int_t fRequiredEvents; // # events required for this calib
+ Int_t fCurrentEvent; // the current event
+ UInt_t fRunno; // Current run number
+ TObjArray fSummaries; // Summary histograms
ClassDef(AliFMDBaseDA,0) // Base Detector algorithm for all run types
};
+//____________________________________________________________________
+inline Bool_t
+AliFMDBaseDA::HasSeenDetector(UShort_t d) const
+{
+ return (d == 0 || d > 3) ? false : fSeenDetectors[d-1];
+}
+
#endif
-/**************************************************************************
+/*************************************************************************
* Copyright(c) 2004, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* 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
-*/
+ *************************************************************************
+ * $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
fSector(0),
fStrip(0),
fName("")
-{}
+{
+ //
+ // CTOR
+ //
+}
//____________________________________________________________________
AliFMDBaseDigit::AliFMDBaseDigit(UShort_t detector,
void
AliFMDBaseDigit::AddTrack(Int_t track)
{
+ //
+ // Add a track referenc
+ //
+ // Parameters:
+ // trackno The track number
+ //
if (fTracks[0] == -1) fTracks[0] = track;
else if (fTracks[1] == -1) fTracks[1] = track;
else if (fTracks[2] == -1) fTracks[2] = track;
UShort_t
AliFMDBaseDigit::GetNTrack() const
{
+ //
+ // Get the number of track references (max 3)
+ //
+ //
+ // Return:
+ // Number of valid track references.
+ //
for (Int_t i = 3; i > 0; i--)
if (fTracks[i-1] != -1) return i;
return 0;
// Destructor
}
+//____________________________________________________________________
+AliFMDBaseDigitizer&
+AliFMDBaseDigitizer::operator=(const AliFMDBaseDigitizer& o)
+{
+ //
+ // Assignment operator
+ //
+ // Return:
+ // Reference to this object
+ //
+ AliDigitizer::operator=(o);
+ fRunLoader = o.fRunLoader;
+ fEdep = o.fEdep;
+ fShapingTime = o.fShapingTime;
+ fStoreTrackRefs = o.fStoreTrackRefs;
+ fIgnoredLabels = o.fIgnoredLabels;
+ return *this;
+}
+
//____________________________________________________________________
Bool_t
AliFMDBaseDigitizer::Init()
fStoreTrackRefs(o.fStoreTrackRefs),
fIgnoredLabels(o.fIgnoredLabels)
{}
- /** Assignment operator
- @return Reference to this object */
- AliFMDBaseDigitizer& operator=(const AliFMDBaseDigitizer& o)
- {
- AliDigitizer::operator=(o);
- fRunLoader = o.fRunLoader;
- fEdep = o.fEdep;
- fShapingTime = o.fShapingTime;
- fStoreTrackRefs = o.fStoreTrackRefs;
- fIgnoredLabels = o.fIgnoredLabels;
- return *this;
- }
+ /**
+ * Assignment operator
+ *
+ * @return Reference to this object
+ */
+ AliFMDBaseDigitizer& operator=(const AliFMDBaseDigitizer& o);
ClassDef(AliFMDBaseDigitizer,4) // Base class for FMD digitizers
};
#include "AliFMDCalibStripRange.h" // ALIFMDCALIBSTRIPRANGE_H
#include <AliCDBManager.h> // ALICDBMANAGER_H
#include <AliCDBEntry.h> // ALICDBMANAGER_H
+#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
//#include <Riostream.h>
#include <TSystem.h>
// #include <TMath.h>
#ifndef ROOT_TTask
# include <TTask.h>
#endif
-#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
+class AliFMDParameters;
+#include "AliFMDCalibFwd.h"
/** @class AliFMDCalibFaker
@brief Class to make fake calibration parameters.
--- /dev/null
+// -*- mode: C++ -*-
+//
+#ifndef ALIFMDCALIBFWD_H
+#define ALIFMDCALIBFWD_H
+#ifndef ALIFMDUSHORTMAP_H
+# include <AliFMDUShortMap.h>
+#endif
+#ifndef ALIFMDBOOLMAP_H
+# include <AliFMDBoolMap.h>
+#endif
+typedef AliFMDUShortMap AliFMDCalibZeroSuppression;
+typedef AliFMDBoolMap AliFMDCalibDeadMap;
+class AliFMDCalibPedestal;
+class AliFMDCalibGain;
+class AliFMDCalibSampleRate;
+class AliFMDCalibStripRange;
+class AliFMDAltroMapping;
+
+#endif
+//
+// EOF
+//
AliFMDBoolMap*
AliFMDCalibPedestal::MakeDeadMap(Float_t maxW, AliFMDBoolMap* dead) const
{
- if (!dead) {
+ //
+ // Make a dead map based on the noise of the channels. If the noise
+ // of a paraticular channel is larger than @a maxW, then the channel
+ // is marked as dead.
+ //
+ // If the argument @a dead is non-null, then the map passed is
+ // modified. That is, channels marked as dead in the map will
+ // remain marked. Channels that meat the criterion (noise larger
+ // than @a maxW) will in addition be marked as dead.
+ //
+ // If the argument @a dead is null, then a new map is created and a
+ // pointer to this will be returned.
+ //
+ // Parameters:
+ // maxW Maximum value of noise for a channel before it is
+ // marked as dead.
+ // dead If non-null, then modify this map.
+ //
+ // Return:
+ // A pointer to possibly newly allocated dead map.
+ //
+ if (!dead) {
dead = new AliFMDBoolMap(0,0,0,0);
dead->Reset(kFALSE);
}
Bool_t
AliFMDCalibPedestal::ReadFromFile(std::istream& in)
{
- // Get header (how long is it ?)
+ //
+ // Read information from file and set values
+ //
+ // Parameters:
+ // inFile inputFile
+ //
TString header;
header.ReadLine(in);
header.ToLower();
AliFMDCalibPedestal();
/** DTOR */
~AliFMDCalibPedestal() {}
- /** Copy ctor
- @param o Object to copy from */
+ /**
+ * Copy ctor
+ *
+ * @param o Object to copy from
+ */
AliFMDCalibPedestal(const AliFMDCalibPedestal& o);
- /** Assignment
- @param o Object to assign from
- @return Reference to this object */
+ /**
+ * Assignment
+ *
+ * @param o Object to assign from
+ * @return Reference to this object
+ */
AliFMDCalibPedestal& operator=(const AliFMDCalibPedestal& o);
- /** Set the values for a strip.
- @param det Detector
- @param ring Ring
- @param sec Sector
- @param str Strip
- @param ped Value of pedestal
- @param pedW Width of pedestal */
+ /**
+ * Set the values for a strip.
+ *
+ * @param det Detector
+ * @param ring Ring
+ * @param sec Sector
+ * @param str Strip
+ * @param ped Value of pedestal
+ * @param pedW Width of pedestal
+ */
void Set(UShort_t det, Char_t ring, UShort_t sec, UShort_t str,
Float_t ped, Float_t pedW);
- /** Get pedestal for a strip.
- @param det Detector
- @param ring Ring
- @param sec Sector
- @param str Strip
- @return Pedestal for strip */
+ /**
+ * Get pedestal for a strip.
+ *
+ * @param det Detector
+ * @param ring Ring
+ * @param sec Sector
+ * @param str Strip
+ * @return Pedestal for strip
+ */
Float_t Value(UShort_t det, Char_t ring, UShort_t sec, UShort_t str);
/** Get pedestal width for a strip.
@param det Detector
Float_t Width(UShort_t det, Char_t ring, UShort_t sec, UShort_t str);
/**
- Read information from file and set values
- @param inFile inputFile
+ * Read information from file and set values
+ *
+ * @param inFile inputFile
*/
Bool_t ReadFromFile(std::istream & inFile);
/**
Short_t count3,
Short_t count4,
UShort_t nrefs,
- Int_t* refs)
+ const Int_t* refs)
: AliFMDBaseDigit(detector, ring, sector, strip),
fCount1(count1),
fCount2(count2),
Short_t count3=-1,
Short_t count4=-1,
UShort_t nrefs=0,
- Int_t* refs=0);
+ const Int_t* refs=0);
/**
* DTOR
*/
-/**************************************************************************
- * 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 AliFMDDigitizer.cxx
- @author Christian Holm Christensen <cholm@nbi.dk>
- @date Mon Mar 27 12:38:26 2006
- @brief FMD Digitizers implementation
- @ingroup FMD_sim
-*/
+//************************************************************************
+// 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 AliFMDDigitizer.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
Bool_t
AliFMDDigitizer::Init()
{
+ //
// Initialisation
+ //
if (!AliFMDBaseDigitizer::Init()) return kFALSE;
#if 0
void
AliFMDDigitizer::Exec(Option_t*)
{
+ //
+ // Execute this digitizer.
+ // This member function will be called once per event by the passed
+ // AliRunDigitizer manager object.
+ //
+ // Parameters:
+ // options Not used
+ //
if (!fManager) {
AliError("No digitisation manager defined");
return;
AliRunLoader* currentLoader =
AliRunLoader::GetRunLoader(fManager->GetInputFolderName(inputFile));
if (!currentLoader) {
- Error("Exec", Form("no run loader for input file # %d", inputFile));
+ Error("Exec", "no run loader for input file # %d", inputFile);
continue;
}
void
AliFMDDigitizer::SumContributions(TBranch* sdigitsBranch)
{
- // Sum energy deposited contributions from each sdigits in a cache
- // (fEdep).
+ //
+ // Sum contributions from SDigits
+ //
+ // Parameters:
+ // sdigitsBranch Branch of SDigit data
+ //
AliFMDDebug(3, ("Runnin our version of SumContributions"));
// Get a list of hits from the FMD manager
//====================================================================
-/** @class AliFMDDigitizer
- @brief Concrete digitizer to make digits from hits. See also
- AliFMDBaseDigitizer documentation.
- @ingroup FMD_sim
+/**
+ * @class AliFMDDigitizer
+ * @brief Concrete digitizer to make digits from hits. See also
+ * AliFMDBaseDigitizer documentation.
+ *
+ * @ingroup FMD_sim
*/
class AliFMDDigitizer : public AliFMDBaseDigitizer
{
public:
- /** CTOR */
+ /**
+ * CTOR
+ */
AliFMDDigitizer() : AliFMDBaseDigitizer() {}
- /** CTOR
- @param manager Manager of digitization */
+ /**
+ * CTOR
+ *
+ * @param manager Manager of digitization
+ */
AliFMDDigitizer(AliRunDigitizer * manager)
: AliFMDBaseDigitizer(manager) {}
- /** DTOR */
+ /**
+ * DTOR
+ */
virtual ~AliFMDDigitizer() {}
- /** Initialise */
+ /**
+ * Initialise
+ */
virtual Bool_t Init();
- /** Execute this digitizer.
- This member function will be called once per event by the passed
- AliRunDigitizer manager object.
- @param options Not used */
+ /**
+ * Execute this digitizer.
+ * This member function will be called once per event by the passed
+ * AliRunDigitizer manager object.
+ *
+ * @param options Not used
+ */
virtual void Exec(Option_t* option="");
protected:
- /** Sum contributions from SDigits
- @param sdigitsBranch Branch of SDigit data */
+ /**
+ * Sum contributions from SDigits
+ *
+ * @param sdigitsBranch Branch of SDigit data
+ */
void SumContributions(TBranch* sdigitsBranch);
ClassDef(AliFMDDigitizer,1) // Make Digits from Hits
* provided "as is" without express or implied warranty. *
**************************************************************************/
/* $Id$ */
-/** @file AliFMDDisplay.cxx
- @author Christian Holm Christensen <cholm@nbi.dk>
- @date Mon Mar 27 12:39:09 2006
- @brief FMD Event display
-*/
+/**
+ * @file AliFMDDisplay.cxx
+ * @author Christian Holm Christensen <cholm@nbi.dk>
+ * @date Mon Mar 27 12:39:09 2006
+ * @brief FMD Event display
+ */
//___________________________________________________________________
//
// The classes defined here, are utility classes for reading in data
AliFMDDisplay::InsideCut(Float_t val, const Float_t& min,
const Float_t& max) const
{
+ //
+ // Whether a point is inside
+ //
+ // Parameters:
+ // v Point
+ // min Minimum
+ // max Maximum
+ //
+ // Return:
+ // true if @a v is inside cut
+ //
Float_t r = max - min;
Float_t l = fSlider->GetMinimum();
Float_t h = fSlider->GetMaximum();
AliFMDDisplay::GetADCThreshold(UShort_t d, Char_t r,
UShort_t s, UShort_t t) const
{
+ //
+ // Get the ADC threshold
+ //
+ // Parameters:
+ // d Detector
+ // r Ring
+ // s Sector
+ // t Strip
+ //
+ // Return:
+ // The threshold
+ //
AliFMDParameters* parm = AliFMDParameters::Instance();
Double_t ped = parm->GetPedestal(d,r, s, t);
Double_t pedW = parm->GetPedestalWidth(d,r, s, t);
class AliFMDDisplay : public AliFMDInput
{
public:
- /** Constructor
- @param onlyFMD Only show the FMD
- @param gAliceFile galice file*/
+ /**
+ * Constructor
+ *
+ * @param onlyFMD Only show the FMD
+ * @param gAliceFile galice file
+ */
AliFMDDisplay(Bool_t onlyFMD=kTRUE, const char* gAliceFile="galice.root");
- /** DTOR */
+ /**
+ * DTOR
+ */
virtual ~AliFMDDisplay();
- /** Singleton access function
- @return Singleton object. */
+ /**
+ * Singleton access function
+ *
+ * @return Singleton object.
+ */
static AliFMDDisplay* Instance();
- /** Continue to next event */
+ /**
+ * Continue to next event
+ */
void Continue() { fWait = kFALSE; }
- /** Run throug events as fast as possible */
+ /**
+ * Run throug events as fast as possible
+ */
void Start() { fContinous = kTRUE; fWait = kFALSE; }
- /** Pause the processing */
+ /**
+ * Pause the processing
+ */
void Pause() { fContinous = kFALSE; fWait = kTRUE; }
- /** Zoom mode */
+ /**
+ * Zoom mode
+ */
void Zoom() { fZoomMode = kTRUE; }
- /** Pick mode */
+ /**
+ * Pick mode
+ */
void Pick() { fZoomMode = kFALSE; }
- /** Redisplay the event */
+ /**
+ * Redisplay the event
+ */
virtual void Redisplay(); // *MENU*
- /** Break */
+ /**
+ * Break
+ */
virtual void Break();
- /** Render in 3D */
+ /**
+ * Render in 3D
+ */
virtual void Render();
- /** Change cut */
+ /**
+ * Change cut
+ */
virtual void ChangeCut();
- /** Change cut */
+ /**
+ * Change cut
+ */
virtual void ChangeFactor();
- /** Called when a mouse or similar event happens in the display.
- @param event Event type
- @param px where the event happened in pixels along X
- @param py where the event happened in pixels along Y */
+ /**
+ * Called when a mouse or similar event happens in the display.
+ *
+ * @param event Event type
+ * @param px where the event happened in pixels along X
+ * @param py where the event happened in pixels along Y
+ */
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
- /** Paint into canvas
- @param option Not used */
+ /**
+ * Paint into canvas
+ *
+ * @param option Not used
+ */
virtual void Paint(Option_t* option="") { (void)option; }
- /** Initialize
- @return @c false on error */
+ /**
+ * Initialize
+ *
+ * @return @c false on error
+ */
virtual Bool_t Init();
- /** Called at beginning of an event
- @param event Event number
- @return @c false on error */
+ /**
+ * Called at beginning of an event
+ *
+ * @param event Event number
+ * @return @c false on error
+ */
virtual Bool_t Begin(Int_t event);
- /** Called at end of an event
- @return @c false on error */
+ /**
+ * Called at end of an event
+ *
+ * @return @c false on error
+ */
virtual Bool_t End();
- /** Visualize a hit
- @param hit Hit
- @param p Track
- @return @c false on error */
+ /**
+ * Visualize a hit
+ *
+ * @param hit Hit
+ * @param p Track
+ * @return @c false on error
+ */
virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle* p);
- /** Visualize a digit
- @param digit Digit to draw
- @return @c false on error */
+ /**
+ * Visualize a digit
+ *
+ * @param digit Digit to draw
+ * @return @c false on error
+ */
virtual Bool_t ProcessDigit(AliFMDDigit* digit);
- /** Visualize a summable digit
- @param sdigit Summable digit to draw
- @return @c false on error */
+ /**
+ * Visualize a summable digit
+ *
+ * @param sdigit Summable digit to draw
+ * @return @c false on error
+ */
virtual Bool_t ProcessSDigit(AliFMDSDigit* sdigit);
- /** Visualize a raw digit
- @param digit Raw digit.
- @return @c false on error */
+ /**
+ * Visualize a raw digit
+ *
+ * @param digit Raw digit.
+ * @return @c false on error
+ */
virtual Bool_t ProcessRawDigit(AliFMDDigit* digit);
- /** Visualize a raw digit
- @param digit Raw digit.
- @return @c false on error */
+ /**
+ * Visualize a raw digit
+ *
+ * @param digit Raw digit.
+ * @return @c false on error
+ */
virtual Bool_t ProcessRawCalibDigit(AliFMDDigit* digit);
- /** Visualize a reconstructed point.
- @param recpoint Reconstructed point
- @return @c false on error */
+ /**
+ * Visualize a reconstructed point.
+ *
+ * @param recpoint Reconstructed point
+ * @return @c false on error
+ */
virtual Bool_t ProcessRecPoint(AliFMDRecPoint* recpoint);
- /** Process ESD data for the FMD. Users should overload this to
- deal with ESD data.
- @param d Detector number (1-3)
- @param r Ring identifier ('I' or 'O')
- @param s Sector number (0-19, or 0-39)
- @param t Strip number (0-511, or 0-255)
- @param eta Psuedo-rapidity
- @param mult Psuedo-multiplicity
- @return @c false on error */
+ /**
+ * Process ESD data for the FMD. Users should overload this to
+ * deal with ESD data.
+ *
+ * @param d Detector number (1-3)
+ * @param r Ring identifier ('I' or 'O')
+ * @param s Sector number (0-19, or 0-39)
+ * @param t Strip number (0-511, or 0-255)
+ * @param eta Psuedo-rapidity
+ * @param mult Psuedo-multiplicity
+ *
+ * @return @c false on error
+ */
virtual Bool_t ProcessESD(UShort_t d, Char_t r, UShort_t s, UShort_t t,
Float_t eta, Float_t mult);
- /** Look up a color index, based on the value @a x and the maximum
- value of @a x
- @param x Value
- @param max Maximum (for example 1023 for digits)
- @return @c false on error */
+ /**
+ * Look up a color index, based on the value @a x and the maximum
+ * value of @a x
+ *
+ * @param x Value
+ * @param max Maximum (for example 1023 for digits)
+ * @return @c false on error
+ */
virtual Int_t LookupColor(Float_t x, Float_t min, Float_t max) const;
- /** Set range of displayed values */
+ /**
+ * Set range of displayed values
+ */
virtual void SetCut(Float_t l=0., Float_t h=1.); //*MENU*
+ /**
+ * Set the noise factor
+ *
+ * @param f Noise factor
+ */
virtual void SetFactor(Float_t f=1);
protected:
- /** Copy constructor
- @param o Object to copy from */
+ /**
+ * Copy constructor
+ *
+ * @param o Object to copy from
+ */
AliFMDDisplay(const AliFMDDisplay& o)
: AliFMDInput(o),
fWait(kFALSE),
fInitialMax(1),
fInitialFactor(3./10)
{ }
- /** Assignment operator
- @return Reference to this object */
+ /**
+ * Assignment operator
+ *
+ * @return Reference to this object
+ */
AliFMDDisplay& operator=(const AliFMDDisplay&) { return *this; }
- /** Add a marker to the display
- @param x X position
- @param y Y position
- @param z Z position
- @param o Object to refer to
- @param s Signal
- @param max Maximum of signal */
+ /**
+ * Add a marker to the display
+ *
+ * @param x X position
+ * @param y Y position
+ * @param z Z position
+ * @param o Object to refer to
+ * @param s Signal
+ * @param max Maximum of signal
+ */
virtual void AddMarker(Float_t x, Float_t y, Float_t z,
TObject* o, Float_t s, Float_t min, Float_t max);
- /** Add a marker to the display
- @param det Detector
- @param rng Ring
- @param sec Sector
- @param str Strip
- @param o Object to refer to
- @param s Signal
- @param max Maximum of signal */
+ /**
+ * Add a marker to the display
+ *
+ * @param det Detector
+ * @param rng Ring
+ * @param sec Sector
+ * @param str Strip
+ * @param o Object to refer to
+ * @param s Signal
+ * @param max Maximum of signal
+ */
virtual void AddMarker(UShort_t det, Char_t rng, UShort_t sec, UShort_t str,
TObject* o, Float_t s, Float_t min, Float_t max);
- /** Show only the FMD detectors. */
+ /**
+ * Show only the FMD detectors.
+ */
void ShowOnlyFMD();
- /** Make base canvas */
+ /**
+ * Make base canvas
+ */
virtual void MakeCanvas(const char** which);
+ /**
+ * Make AUX canvas
+ *
+ */
virtual void MakeAux();
+ /**
+ * Draw AUX canvas
+ *
+ */
virtual void DrawAux();
+ /**
+ * Set the ROOT event loop to idle
+ *
+ */
virtual void Idle();
+ /**
+ * Called at end of event loop
+ *
+ */
virtual void AtEnd();
+ /**
+ * Whether a point is inside
+ *
+ * @param v Point
+ * @param min Minimum
+ * @param max Maximum
+ *
+ * @return true if @a v is inside cut
+ */
virtual Bool_t InsideCut(Float_t v, const Float_t& min,
const Float_t& max) const;
+ /**
+ * Get the ADC threshold
+ *
+ * @param d Detector
+ * @param r Ring
+ * @param s Sector
+ * @param t Strip
+ *
+ * @return The threshold
+ */
virtual Double_t GetADCThreshold(UShort_t d, Char_t r,
UShort_t s, UShort_t t) const;
TH1* fSpecCut; // Cut spectra
TCanvas* fAux; // Aux canvas.
Bool_t fReturn; // Stop
- Bool_t fContinous;
- TTimer fTimeout;
- Float_t fInitialMin;
- Float_t fInitialMax;
- Float_t fInitialFactor;
+ Bool_t fContinous; // Run continuous - do not stop
+ TTimer fTimeout; // Timeout
+ Float_t fInitialMin;// Initial minimum
+ Float_t fInitialMax;// Initial maximum
+ Float_t fInitialFactor;//Initial factor
struct Range_t {
- UInt_t fNbins;
- Float_t fLow;
- Float_t fHigh;
+ UInt_t fNbins; // Number of bins
+ Float_t fLow; // Low cut
+ Float_t fHigh; // High cut
};
- static const Range_t fgkEdepRange;
- static const Range_t fgkAdcRange;
- static const Range_t fgkMultRange;
+ static const Range_t fgkEdepRange; // Energy loss range
+ static const Range_t fgkAdcRange; // ADC counts range
+ static const Range_t fgkMultRange; // Multiplicity range
ClassDef(AliFMDDisplay,0) // FMD specialised event display
};
fFMD1Pad->cd();
fFMD1.End();
fFMD1Pad->Modified();
- fFMD1IHits.SetTitle(Form("# hits in FMD1I: %5d", fFMD1.fNInnerHits));
- total += fFMD1.fNInnerHits;
+ fFMD1IHits.SetTitle(Form("# hits in FMD1I: %5d", fFMD1.GetNInnerHits()));
+ total += fFMD1.GetNInnerHits();
}
if ((/*det =*/ geom->GetDetector(2))) {
fFMD2Pad->cd();
fFMD2.End();
fFMD2Pad->Modified();
- fFMD2IHits.SetTitle(Form("# hits in FMD2I: %5d", fFMD2.fNInnerHits));
- fFMD2OHits.SetTitle(Form("# hits in FMD2O: %5d", fFMD2.fNOuterHits));
- total += fFMD2.fNInnerHits;
- total += fFMD2.fNOuterHits;
+ fFMD2IHits.SetTitle(Form("# hits in FMD2I: %5d", fFMD2.GetNInnerHits()));
+ fFMD2OHits.SetTitle(Form("# hits in FMD2O: %5d", fFMD2.GetNOuterHits()));
+ total += fFMD2.GetNInnerHits();
+ total += fFMD2.GetNOuterHits();
}
if ((/*det =*/ geom->GetDetector(3))) {
fFMD3Pad->cd();
fFMD3.End();
fFMD3Pad->Modified();
- fFMD3IHits.SetTitle(Form("# hits in FMD3I: %5d", fFMD3.fNInnerHits));
- fFMD3OHits.SetTitle(Form("# hits in FMD3O: %5d", fFMD3.fNOuterHits));
- total += fFMD3.fNInnerHits;
- total += fFMD3.fNOuterHits;
+ fFMD3IHits.SetTitle(Form("# hits in FMD3I: %5d", fFMD3.GetNInnerHits()));
+ fFMD3OHits.SetTitle(Form("# hits in FMD3O: %5d", fFMD3.GetNOuterHits()));
+ total += fFMD3.GetNInnerHits();
+ total += fFMD3.GetNOuterHits();
}
fTotal.SetTitle(Form("Total: %5d/51200 (%3d%%)",
total, Int_t(100. / 51200 * total)));
/** Add a marker */
void AddMarker(Char_t rng, UShort_t sec, UShort_t str,
Float_t v, Float_t max);
+
+ /**
+ * Get Mother frame
+ *
+ * @return Mother frame
+ */
+ TH1*& GetFrame() { return fFrame; }
+ /**
+ * Set Mother frame
+ *
+ * @param p
+ */
+ void SetFrame(TH1* p) { fFrame = p; }
+ /**
+ * Get Identifier
+ *
+ * @return Identifier
+ */
+ Int_t GetId() const { return fId; }
+ /**
+ * Set Identifier
+ *
+ * @param p
+ */
+ void SetId(Int_t p) { fId = p; }
+ /**
+ * Get Array of shapes
+ *
+ * @return Array of shapes
+ */
+ TObjArray& GetShapes() { return fShapes; }
+ /**
+ * Get Number of inner hits
+ *
+ * @return Number of inner hits
+ */
+ Int_t& GetNInnerHits() { return fNInnerHits; }
+ /**
+ * Get Graph of inner hits
+ *
+ * @return Graph of inner hits
+ */
+ TGraph2D& GetInnerHits() { return fInnerHits; }
+ /**
+ * Get Number of outer hits
+ *
+ * @return Number of outer hits
+ */
+ Int_t& GetNOuterHits() { return fNOuterHits; }
+ /**
+ * Get Graph of outer hits
+ *
+ * @return Graph of outer hits
+ */
+ TGraph2D& GetOuterHits() { return fOuterHits; }
+ /**
+ * Get Maximum radius
+ *
+ * @return Maximum radius
+ */
+ Double_t GetMaxR() const { return fMaxR; }
+ /**
+ * Set Maximum radius
+ *
+ * @param p
+ */
+ void SetMaxR(Double_t p) { fMaxR = p; }
+ /**
+ * Get Minimum Z
+ *
+ * @return Minimum Z
+ */
+ Double_t GetMinZ() const { return fMinZ; }
+ /**
+ * Set Minimum Z
+ *
+ * @param p
+ */
+ void SetMinZ(Double_t p) { fMinZ = p; }
+ /**
+ * Get Maximum Z
+ *
+ * @return Maximum Z
+ */
+ Double_t GetMaxZ() const { return fMaxZ; }
+ /**
+ * Set Maximum Z
+ *
+ * @param p
+ */
+ void SetMaxZ(Double_t p) { fMaxZ = p; }
+ protected:
/** Mother frame */
TH1* fFrame; // Mother frame
/** Identifier */
// pulse and the response of the detector.
//
#include "AliFMDGainDA.h"
-// #include <iostream>
-// #include <fstream>
-#include "AliLog.h"
-#include "TF1.h"
-#include "TH1S.h"
-// #include "TMath.h"
-#include "TGraphErrors.h"
-#include "AliFMDParameters.h"
#include "AliFMDAltroMapping.h"
+#include "AliFMDParameters.h"
+#include "AliFMDCalibGain.h"
+#include "AliFMDDigit.h"
+#include "AliLog.h"
+#include <TFile.h>
+#include <TF1.h>
+#include <TH1S.h>
+#include <TGraphErrors.h>
#include <TDatime.h>
#include <TH2.h>
* provided "as is" without express or implied warranty. *
**************************************************************************/
/* $Id$ */
-/** @file AliFMDGeometry.cxx
- @author Christian Holm Christensen <cholm@nbi.dk>
- @date Mon Mar 27 12:40:37 2006
- @brief Geometry mananger for the FMD
-*/
+/**
+ * @file AliFMDGeometry.cxx
+ * @author Christian Holm Christensen <cholm@nbi.dk>
+ * @date Mon Mar 27 12:40:37 2006
+ * @brief Geometry mananger for the FMD
+ */
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers.
AliFMDGeometry*
AliFMDGeometry::Instance()
{
- // Return (newly created) singleton instance
- if (!fgInstance) fgInstance = new AliFMDGeometry;
+ //
+ // singleton access
+ //
+ // Return:
+ // Singleton
+ //
+ if (!fgInstance) fgInstance = new AliFMDGeometry("FMD");
return fgInstance;
}
//____________________________________________________________________
AliFMDGeometry::AliFMDGeometry()
+ : AliGeometry(),
+ fIsInitialized(kFALSE),
+ fInner(0),
+ fOuter(0),
+ fFMD1(0),
+ fFMD2(0),
+ fFMD3(0),
+ fUseFMD1(kTRUE),
+ fUseFMD2(kTRUE),
+ fUseFMD3(kTRUE),
+ fIsInitTrans(kFALSE),
+ fBuilder(0),
+ fDetectorOff(0),
+ fModuleOff(0),
+ fRingOff(0),
+ fSectorOff(0),
+ fActive(2),
+ fDetailed(kTRUE),
+ fUseAssembly(kTRUE)
+{
+ // PROTECTED
+ //
+ // CTOR
+ //
+}
+
+//____________________________________________________________________
+AliFMDGeometry::AliFMDGeometry(const char* )
: AliGeometry("FMD", "Forward multiplicity"),
fIsInitialized(kFALSE),
fInner(0),
fFMD1(0),
fFMD2(0),
fFMD3(0),
- fUseFMD1(kFALSE),
- fUseFMD2(kFALSE),
- fUseFMD3(kFALSE),
+ fUseFMD1(kTRUE),
+ fUseFMD2(kTRUE),
+ fUseFMD3(kTRUE),
fIsInitTrans(kFALSE),
fBuilder(0),
fDetectorOff(0),
fRingOff(0),
fSectorOff(0),
fActive(2),
- fDetailed(kFALSE),
- fUseAssembly(kFALSE)
+ fDetailed(kTRUE),
+ fUseAssembly(kTRUE)
{
// PROTECTED
- // Default constructor
- fUseFMD1 = kTRUE;
- fUseFMD2 = kTRUE;
- fUseFMD3 = kTRUE;
- fDetailed = kTRUE;
- fUseAssembly = kTRUE;
- fInner = new AliFMDRing('I');
- fOuter = new AliFMDRing('O');
- fFMD1 = new AliFMD1(fInner);
- fFMD2 = new AliFMD2(fInner, fOuter);
- fFMD3 = new AliFMD3(fInner, fOuter);
- fIsInitialized = kFALSE;
- fActive.Reset(-1);
+ //
+ // CTOR
+ //
+ // Parameters:
+ // name Not used
+ //
}
//____________________________________________________________________
fUseAssembly(other.fUseAssembly)
{
// PROTECTED
- // Copy constructor
+ //
+ // Copy CTOR
+ //
+ // Parameters:
+ // other To copy from
+ //
}
AliFMDGeometry::operator=(const AliFMDGeometry& other)
{
// PROTECTED
+ //
// Assignment operator
+ //
+ // Parameters:
+ // other To assig from
+ // Return:
+ // reference to this.
+ //
fUseFMD1 = other.fUseFMD1;
fUseFMD2 = other.fUseFMD2;
fUseFMD3 = other.fUseFMD3;
void
AliFMDGeometry::Init()
{
+ //
// Initialize the the singleton if not done so already
+ //
if (fIsInitialized) return;
fInner->Init();
fOuter->Init();
void
AliFMDGeometry::InitTransformations(Bool_t force)
{
+ //
// Find all local <-> global transforms
+ //
if (force) fIsInitTrans = kFALSE;
if (fIsInitTrans) return;
if (!gGeoManager) {
void
AliFMDGeometry::Build()
{
- // Build the geometry
+ //
+ // Make the geometry. This delegates to AliFMDGeometryBuilder
+ //
if (!fBuilder) fBuilder = new AliFMDGeometryBuilder(fDetailed);
fBuilder->SetDetailed(fDetailed);
fBuilder->UseAssembly(fUseAssembly);
void
AliFMDGeometry::SetActive(Int_t* active, Int_t n)
{
+ //
// Set active volumes
+ //
+ // Parameters:
+ // active Active volume id array
+ // n elements of @a active
+ //
fActive.Set(n);
for (Int_t i = 0; i < n; i++) {
AliFMDDebug(1, ("Active vol id # %d: %d", i, active[i]));
void
AliFMDGeometry::AddActive(Int_t active)
{
+ //
// Add an active volume
+ //
+ // Parameters:
+ // id Register volume @a id to be active
+ //
+ //
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
+ //
+ // Check if volume @a vol is marked as active
+ //
+ // Parameters:
+ // vol Volume ID
+ // Return:
+ // @c true if @a vol is declared active
+ //
for (Int_t i = 0; i < fActive.fN; i++)
if (fActive[i] == vol) return kTRUE;
return kFALSE;
AliFMDDetector*
AliFMDGeometry::GetDetector(Int_t i) const
{
- // Get the ith detector. i should be one of 1, 2, or 3. If an
- // invalid value is passed, 0 (NULL) is returned.
+ //
+ // Get description of a sub-detector
+ //
+ // Parameters:
+ // i Sub-detector #
+ // Return:
+ // Description of sub-detector, or 0
+ //
switch (i) {
case 1: return fUseFMD1 ? static_cast<AliFMDDetector*>(fFMD1) : 0;
case 2: return fUseFMD2 ? static_cast<AliFMDDetector*>(fFMD2) : 0;
AliFMDRing*
AliFMDGeometry::GetRing(Char_t i) const
{
- // Get the ith ring. i should be one of 'I' or 'O' (case
+ //
+ // Get description of a ring, i should be one of 'I' or 'O' (case
// insensitive). If an invalid parameter is passed, 0 (NULL) is
- // returned.
+ // returned.
+ //
+ // Parameters:
+ // i Ring id
+ // Return:
+ // Description of ring, or 0
+ //
switch (i) {
case 'I':
case 'i': return fInner;
void
AliFMDGeometry::Enable(Int_t i)
{
- // Enable the ith detector. i should be one of 1, 2, or 3
+ //
+ // Enable the ith detector
+ //
+ // Parameters:
+ // i IF true, enable sub-detector @a i
+ //
switch (i) {
case 1: fUseFMD1 = kTRUE; break;
case 2: fUseFMD2 = kTRUE; break;
void
AliFMDGeometry::Disable(Int_t i)
{
- // Disable the ith detector. i should be one of 1, 2, or 3
+ //
+ // Disable the ith detector
+ //
+ // Parameters:
+ // i IF true, disable sub-detector @a i
+ //
switch (i) {
case 1: fUseFMD1 = kFALSE; break;
case 2: fUseFMD2 = kFALSE; break;
Double_t& y,
Double_t& z) const
{
- // Translate detector coordinates (detector, ring, sector, strip) to
- // spatial coordinates (x, y, z) in the master reference frame of
- // ALICE.
+ //
+ // Translate detector coordinates (detector, ring, sector, strip)
+ // to spatial coordinates (x, y, z) in the master reference frame
+ // of ALICE. The member function uses the transformations
+ // previously obtained from the TGeoManager.
+ //
+ // Parameters:
+ // detector Detector number
+ // ring Ring id
+ // sector Sector number
+ // strip Strip number
+ // x On return, X coordinate
+ // y On return, Y coordinate
+ // z On return, Z coordinate
+ //
AliFMDDetector* det = GetDetector(detector);
if (!det) {
AliWarning(Form("Unknown detector %d", detector));
UShort_t& sector,
UShort_t& strip) const
{
- // Translate spatial coordinates (x,y,z) in the master reference frame of
- // ALICE to the detector coordinates (detector, ring, sector,
- // strip). Note, that if this method is to be used in
- // reconstruction or the like, then the input z-coordinate should be
- // corrected for the events interactions points z-coordinate, like
+ //
+ // Translate spatial coordinates (x,y,z) in the master reference
+ // frame of ALICE to the detector coordinates (detector, ring,
+ // sector, strip). Note, that if this method is to be used in
+ // reconstruction or the like, then the input z-coordinate should
+ // be corrected for the events interactions points z-coordinate,
+ // like
+ // @code
// geom->XYZ2Detector(x,y,z-ipz,d,r,s,t);
+ // @endcode
+ //
+ // Parameters:
+ // x X coordinate
+ // y Y coordinate
+ // z Z coordinate
+ // detector On return, Detector number
+ // ring On return, Ring id
+ // sector On return, Sector number
+ // strip On return, Strip number
+ // Return:
+ // @c false of (@a x, @a y, @a z) is not within this
+ // detector.
+ //
AliFMDDetector* det = 0;
detector = 0;
for (int i = 1; i <= 3; i++) {
Double_t& phi, Double_t& theta)
{
- // Service function to convert Cartisean XYZ to r, eta, phi, and theta.
//
+ // Service function to convert Cartisean XYZ to r, eta, phi, and theta.
+ //
// Note, that the z input should be corrected for the vertex location
// if needed.
- //
- // x Cartisean X coordinate
- // y Cartisean Y coordinate
- // z Cartisean Z coordinate
- // r On return, the radius
- // eta On return, the pseudo-rapidity
- // phi On return, the azimuthal angle
- // theta On return, the polar angle;
//
+ // Parameters:
+ // x Cartisean X coordinate
+ // y Cartisean Y coordinate
+ // z Cartisean Z coordinate
+ // r On return, the radius
+ // eta On return, the pseudo-rapidity
+ // phi On return, the azimuthal angle
+ // theta On return, the polar angle;
+ //
// Return:
- // kFALSE in case of problems.
-
+ // kTRUE on success, kFALSE in case of problems
+ //
if (x == 0 && y == 0 && z == 0) return kFALSE;
// Correct for vertex offset.
TVector3& pos,
TMatrixF& /* mat */) const
{
- // Get the global coordinates cooresponding to the reconstructed
- // point p. The coordiates is returned in the 3-vector pos passed
- // to this member function. The matrix mat is used for rotations.
+ //
+ // Get global coordinates cooresponding to a rec point.
+ //
+ // Parameters:
+ // p Reconstructed point.
+ // pos On return, the position
+ // mat On return, the material at @a post
+ //
GetGlobal(p, pos);
}
void
AliFMDGeometry::GetGlobal(const AliRecPoint* p, TVector3& pos) const
{
- // Get the global coordinates cooresponding to the reconstructed
- // point p. The coordiates is returned in the 3-vector pos passed
- // to this member function. Note, as AliRecPoint only has places for
- // 3 indicies, it is assumed that the ring hit is an inner ring -
- // which obviously needn't be the case. This makes the member
- // function pretty darn useless.
+ //
+ // Get global coordinates cooresponding to a rec point.
+ //
+ // Parameters:
+ // p Reconstructed point.
+ // pos On return, the position
+ //
// FIXME: Implement this function to work with outer rings too.
Double_t x, y, z;
TVector3 local;
Bool_t
AliFMDGeometry::Impact(const TParticle* /* particle */) const
{
- // Return true, if the particle will hit the active detector
- // elements, and false if not. Should be used for fast
- // simulations. Note, that the function currently return false
- // always.
- // FIXME: Implement this function.
+ //
+ // Check if particle will hit an active detector element.
+ //
+ // @todo implement this function
+ //
+ // Parameters:
+ // particle Track
+ // Return:
+ // @c true if @a particle will hit this detector
+ //
return kFALSE;
}
void
AliFMDGeometry::SetAlignableVolumes() const
{
- // Declare alignable volumes
+ //
+ // Declare alignable volumes
+ //
for (Int_t d = 1; d <= 3; d++)
if (GetDetector(d)) GetDetector(d)->SetAlignableVolumes();
}
class AliFMDGeometry : public AliGeometry
{
public:
- /** @return Singleton */
+ /**
+ * singleton access
+ *
+ * @return Singleton
+ */
static AliFMDGeometry* Instance();
- /** Initialize */
+ /**
+ * Initialize the the singleton if not done so already
+ */
virtual void Init();
- /** Initialize transforms */
+ /**
+ * Find all local <-> global transforms
+ */
virtual void InitTransformations(Bool_t force=kFALSE);
- /** @return Get inner description */
+ /**
+ * @return Get inner description
+ */
AliFMDRing* GetInner() const { return fInner; }
- /** @return Get outer description */
+ /**
+ * @return Get outer description
+ */
AliFMDRing* GetOuter() const { return fOuter; }
- /** @return Get FMD1 description */
+ /**
+ * @return Get FMD1 description
+ */
AliFMD1* GetFMD1() const { return (fUseFMD1 ? fFMD1 : 0); }
- /** @return Get FMD2 description */
+ /**
+ * @return Get FMD2 description
+ */
AliFMD2* GetFMD2() const { return (fUseFMD2 ? fFMD2 : 0); }
- /** @return Get FMD3 description */
+ /**
+ * @return Get FMD3 description
+ */
AliFMD3* GetFMD3() const { return (fUseFMD3 ? fFMD3 : 0); }
- /** Get description of a sub-detector
- @param i Sub-detector #
- @return Description of sub-detector, or 0 */
+ /**
+ * Get description of a sub-detector
+ *
+ * @param i Sub-detector #
+ * @return Description of sub-detector, or 0
+ */
AliFMDDetector* GetDetector(Int_t i) const;
- /** Get description of a ring
- @param i Ring id
- @return Description of ring, or 0 */
+ /**
+ * Get description of a ring, i should be one of 'I' or 'O' (case
+ * insensitive). If an invalid parameter is passed, 0 (NULL) is
+ * returned.
+ *
+ * @param i Ring id
+ * @return Description of ring, or 0
+ */
AliFMDRing* GetRing(Char_t i) const;
- /** @param i IF true, disable sub-detector @a i */
+ /**
+ * Disable the ith detector
+ *
+ * @param i IF true, disable sub-detector @a i
+ */
void Disable(Int_t i);
- /** @param i IF true, enable sub-detector @a i */
+ /**
+ * Enable the ith detector
+ *
+ * @param i IF true, enable sub-detector @a i
+ */
void Enable(Int_t i);
- /** @return Density @f$ \rho@f$ of silicon */
+ /**
+ * @return Density @f$ \rho@f$ of silicon
+ */
Double_t GetSiDensity() const { return 2.33; }
- /** Translate detector coordinates (detector, ring, sector, strip)
- to spatial coordinates (x, y, z) in the master reference frame
- of ALICE. The member function uses the transformations
- previously obtained from the TGeoManager.
- @param detector Detector number
- @param ring Ring id
- @param sector Sector number
- @param strip Strip number
- @param x On return, X coordinate
- @param y On return, Y coordinate
- @param z On return, Z coordinate */
+ /**
+ * Translate detector coordinates (detector, ring, sector, strip)
+ * to spatial coordinates (x, y, z) in the master reference frame
+ * of ALICE. The member function uses the transformations
+ * previously obtained from the TGeoManager.
+ *
+ * @param detector Detector number
+ * @param ring Ring id
+ * @param sector Sector number
+ * @param strip Strip number
+ * @param x On return, X coordinate
+ * @param y On return, Y coordinate
+ * @param z On return, Z coordinate
+ */
void Detector2XYZ(UShort_t detector, Char_t ring,
UShort_t sector, UShort_t strip,
Double_t& x, Double_t& y, Double_t& z) const;
- /** Translate spatial coordinates (x,y,z) in the master reference
- frame of ALICE to the detector coordinates (detector, ring,
- sector, strip). Note, that if this method is to be used in
- reconstruction or the like, then the input z-coordinate should
- be corrected for the events interactions points z-coordinate,
- like
- @code
- geom->XYZ2Detector(x,y,z-ipz,d,r,s,t);
- @endcode
- @param x X coordinate
- @param y Y coordinate
- @param z Z coordinate
- @param detector On return, Detector number
- @param ring On return, Ring id
- @param sector On return, Sector number
- @param strip On return, Strip number
- @return @c false of (@a x, @a y, @a z) is not within this
- detector. */
+ /**
+ * Translate spatial coordinates (x,y,z) in the master reference
+ * frame of ALICE to the detector coordinates (detector, ring,
+ * sector, strip). Note, that if this method is to be used in
+ * reconstruction or the like, then the input z-coordinate should
+ * be corrected for the events interactions points z-coordinate,
+ * like
+ * @code
+ * geom->XYZ2Detector(x,y,z-ipz,d,r,s,t);
+ * @endcode
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
+ * @param detector On return, Detector number
+ * @param ring On return, Ring id
+ * @param sector On return, Sector number
+ * @param strip On return, Strip number
+ * @return @c false of (@a x, @a y, @a z) is not within this
+ * detector.
+ */
Bool_t XYZ2Detector(Double_t x, Double_t y, Double_t z,
UShort_t& detector, Char_t& ring,
UShort_t& sector, UShort_t& strip) const;
- /** Make the geometry. This delegates to AliFMDGeometryBuilder */
+ /**
+ * Make the geometry. This delegates to AliFMDGeometryBuilder
+ */
void Build();
- /** @return Get detector offset in paths */
+ /**
+ * @return Get detector offset in paths
+ */
Int_t GetDetectorOff() const { return fDetectorOff; }
- /** @return Get sensor offset in paths */
+ /**
+ * @return Get sensor offset in paths
+ */
Int_t GetModuleOff() const { return fModuleOff; }
- /** @return Get ring offset in paths */
+ /**
+ * @return Get ring offset in paths
+ */
Int_t GetRingOff() const { return fRingOff; }
- /** @return Get ring sector in paths */
+ /**
+ * @return Get ring sector in paths
+ */
Int_t GetSectorOff() const { return fSectorOff; }
- /** @param off Detector off-set set in geometry path */
+ /**
+ * @param off Detector off-set set in geometry path
+ */
void SetDetectorOff(Int_t off) { fDetectorOff = off; }
- /** @param off Module off-set set in geometry path */
+ /**
+ * @param off Module off-set set in geometry path
+ */
void SetModuleOff(Int_t off) { fModuleOff = off; }
- /** @param off Ring off-set set in geometry path */
+ /**
+ * @param off Ring off-set set in geometry path
+ */
void SetRingOff(Int_t off) { fRingOff = off; }
- /** @param off Sectord off-set set in geometry path */
+ /**
+ * @param off Sectord off-set set in geometry path
+ */
void SetSectorOff(Int_t off) { fSectorOff = off; }
- /** Check if volume @a vol is marked as active
- @param vol Volume ID
- @return @c true if @a vol is declared active */
+ /**
+ * Check if volume @a vol is marked as active
+ *
+ * @param vol Volume ID
+ * @return @c true if @a vol is declared active
+ */
Bool_t IsActive(Int_t vol) const;
- /** Set active volumes
- @param active Active volume id array
- @param n elements of @a active */
+ /**
+ * Set active volumes
+ *
+ * @param active Active volume id array
+ * @param n elements of @a active
+ */
void SetActive(Int_t* active, Int_t n);
- /** @param id Register volume @a id to be active */
+ /**
+ * Add an active volume
+ *
+ * @param id Register volume @a id to be active
+ */
void AddActive(Int_t id);
- /** Get Array of active volume numbers
- @return constant reference to active volume numbers */
+ /**
+ * Get Array of active volume numbers
+ *
+ * @return constant reference to active volume numbers
+ */
const TArrayI& ActiveIds() const { return fActive; }
- /** Set an external geometry builder
- @param b Geometry builder */
+ /**
+ * Set an external geometry builder
+ *
+ * @param b Geometry builder
+ */
void SetBuilder(AliFMDGeometryBuilder* b) { fBuilder = b; }
- /** Extract informaton from TGeoManager */
+ /**
+ * Check the volume depth of some nodes, get the active volume
+ * numbers, and so forth.
+ *
+ * @todo Here, we should actually also get the parameters of the
+ * shapes, like the verticies of the polygon shape that makes up the
+ * silicon sensor, the strip pitch, the ring radii, the z-positions,
+ * and so on - that is, all the geometric information we need for
+ * futher processing, such as simulation, digitization,
+ * reconstruction, etc.
+ */
void ExtractGeomInfo();
- /** Whether we are to use a detailed geometry or not
- @param det if @c true, make a detailed geometry. */
+ /**
+ * Whether we are to use a detailed geometry or not
+ *
+ * @param det if @c true, make a detailed geometry.
+ */
void SetDetailed(Bool_t det) { fDetailed = det; }
- /** @return @c true if geometry is detailed */
+ /**
+ * @return @c true if geometry is detailed
+ */
Bool_t IsDetailed() const { return fDetailed; }
- /** @param ass Whether to use assemblies or not */
+ /**
+ * @param ass Whether to use assemblies or not
+ */
void UseAssembly(Bool_t ass) { fUseAssembly = ass; }
// AliGeometry member functions
- /** Get global coordinates cooresponding to a rec point.
- @param p Reconstructed point.
- @param pos On return, the position
- @param mat On return, the material at @a post */
+ /**
+ * Get global coordinates cooresponding to a rec point.
+ *
+ * @param p Reconstructed point.
+ * @param pos On return, the position
+ * @param mat On return, the material at @a post
+ */
virtual void GetGlobal(const AliRecPoint* p, TVector3& pos,
TMatrixF& mat) const;
- /** Get global coordinates cooresponding to a rec point.
- @param p Reconstructed point.
- @param pos On return, the position */
+ /**
+ * Get global coordinates cooresponding to a rec point.
+ *
+ * @param p Reconstructed point.
+ * @param pos On return, the position
+ */
virtual void GetGlobal(const AliRecPoint* p, TVector3& pos) const;
- /** Check if particle will hit an active detector element. Note
- done yet.
- @param particle Track
- @return @c true if @a particle will hit this detector */
+ /**
+ * Check if particle will hit an active detector element.
+ *
+ * @todo implement this function
+ *
+ * @param particle Track
+ * @return @c true if @a particle will hit this detector
+ */
virtual Bool_t Impact(const TParticle* particle) const;
- /** Declare alignable volumes */
+ /**
+ * Declare alignable volumes
+ */
virtual void SetAlignableVolumes() const;
Bool_t fUseFMD3; // Wheter to Use FMD3 or not
Bool_t fIsInitTrans; // Transforms initialised?
static AliFMDGeometry* fgInstance; // Singleton instance
- /** CTOR */
+ /**
+ * CTOR
+ */
AliFMDGeometry();
- /** Copy CTOR
- @param other To copy from */
+ /**
+ * CTOR
+ *
+ * @param name Not used
+ */
+ AliFMDGeometry(const char* name);
+ /**
+ * Copy CTOR
+ *
+ * @param other To copy from
+ */
AliFMDGeometry(const AliFMDGeometry& other);
- /** Assignment operator
- @param other To assig from
- @return reference to this. */
+ /**
+ * Assignment operator
+ *
+ * @param other To assig from
+ * @return reference to this.
+ */
AliFMDGeometry& operator=(const AliFMDGeometry& other);
+ /**
+ * Destructor
+ */
virtual ~AliFMDGeometry() {}
AliFMDGeometryBuilder* fBuilder; // Geometry builder
AliFMDGeometryBuilder::MakeXTRU(const TObjArray& verticies,
Double_t thick) const
{
+ //
+ // Make a polygonic extrusion shape based on verticies passed in @a
+ // verticies
+ //
+ // Parameters:
+ // verticies List of verticies
+ // thick Thickness
+ //
+ // Return:
+ // newly allocated polygonic extrusion shape
+ //
TArrayD xs(6);
TArrayD ys(6);
for (Int_t i = 0; i < 3; i++) {
//____________________________________________________________________
TGeoVolume*
-AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
+AliFMDGeometryBuilder::RingGeometry(const AliFMDRing* r)
{
// Setup the geometry of a ring. The defined TGeoVolume is
// returned, and should be used when setting up the rest of the
TGeoVolume*
AliFMDGeometryBuilder::TensionBox()
{
+ //
+ // Get the tension box volume
+ //
+ //
+ // Return:
+ //
+ //
static TGeoVolumeAssembly* tensionBox = 0;
if (tensionBox) return tensionBox;
//____________________________________________________________________
TGeoVolume*
-AliFMDGeometryBuilder::DetectorGeometry(AliFMDDetector* d,
+AliFMDGeometryBuilder::DetectorGeometry(const AliFMDDetector* d,
TGeoVolume* topMother,
TGeoVolume* botMother,
Double_t zMother,
//____________________________________________________________________
TGeoVolume*
-AliFMDGeometryBuilder::FMD1Geometry(AliFMD1* fmd1,
+AliFMDGeometryBuilder::FMD1Geometry(const AliFMD1* fmd1,
TGeoVolume* innerTop,
TGeoVolume* innerBot)
{
//____________________________________________________________________
TGeoVolume*
-AliFMDGeometryBuilder::FMD2Geometry(AliFMD2* fmd2,
+AliFMDGeometryBuilder::FMD2Geometry(const AliFMD2* fmd2,
TGeoVolume* innerTop,
TGeoVolume* innerBot,
TGeoVolume* outerTop,
//____________________________________________________________________
TGeoVolume*
-AliFMDGeometryBuilder::FMD3Geometry(AliFMD3* fmd3,
+AliFMDGeometryBuilder::FMD3Geometry(const AliFMD3* fmd3,
TGeoVolume* innerTop,
TGeoVolume* innerBot,
TGeoVolume* outerTop,
*
* @return Ring volume
*/
- virtual TGeoVolume* RingGeometry(AliFMDRing* r);
+ virtual TGeoVolume* RingGeometry(const AliFMDRing* r);
/**
* Make a honey comb shape from passed parameters.
* @return
*/
virtual TGeoVolume* TensionBox();
- /** Make a detector volume
- @param d Detector geometry
- @param motherTop Mother volume (detector volume)
- @param motherBot Mother volume (detector volume)
- @param zmother Z position of mother
- @param innerTop Inner ring volume
- @param innerBot Inner ring volume
- @param outerTop Outer ring volume
- @param outerBot Outer ring volume
- @return Detector volume */
- virtual TGeoVolume* DetectorGeometry(AliFMDDetector* d,
+ /**
+ * Make a detector volume
+ *
+ * @param d Detector geometry
+ * @param motherTop Mother volume (detector volume)
+ * @param motherBot Mother volume (detector volume)
+ * @param zmother Z position of mother
+ * @param innerTop Inner ring volume
+ * @param innerBot Inner ring volume
+ * @param outerTop Outer ring volume
+ * @param outerBot Outer ring volume
+ *
+ * @return Detector volume
+ */
+ virtual TGeoVolume* DetectorGeometry(const AliFMDDetector* d,
TGeoVolume* motherTop,
TGeoVolume* motherBot,
Double_t zmother,
TGeoVolume* innerBot,
TGeoVolume* outerTop=0,
TGeoVolume* outerBot=0);
- /** Make FMD1 volume
- @param d Detector geometry
- @param innerTop Inner ring volume
- @param innerBot Inner ring volume
- @return FMD1 volume */
- virtual TGeoVolume* FMD1Geometry(AliFMD1* d,
+ /**
+ * Make FMD1 volume
+ *
+ * @param d Detector geometry
+ * @param innerTop Inner ring volume
+ * @param innerBot Inner ring volume
+ * @return FMD1 volume
+ */
+ virtual TGeoVolume* FMD1Geometry(const AliFMD1* d,
TGeoVolume* innerTop,
TGeoVolume* innerBot);
/**
*
* @return FMD2 volume
*/
- virtual TGeoVolume* FMD2Geometry(AliFMD2* d,
+ virtual TGeoVolume* FMD2Geometry(const AliFMD2* d,
TGeoVolume* innerTop,
TGeoVolume* innerBot,
TGeoVolume* outerTop,
*
* @return FMD3 volume
*/
- virtual TGeoVolume* FMD3Geometry(AliFMD3* d,
+ virtual TGeoVolume* FMD3Geometry(const AliFMD3* d,
TGeoVolume* innerTop,
TGeoVolume* innerBot,
TGeoVolume* outerTop,
fFMD = fmd;
}
+//____________________________________________________________________
+AliFMDHitDigitizer&
+AliFMDHitDigitizer::operator=(const AliFMDHitDigitizer& o)
+{
+ /**
+ * Assignment operator
+ *
+ * @param o Object to assign from
+ * @return Reference to this
+ */
+ AliFMDBaseDigitizer::operator=(o);
+ fHoldTime = o.fHoldTime;
+ fOutput = o.fOutput;
+ fStack = o.fStack;
+ return *this;
+}
+
//____________________________________________________________________
void
AliFMDHitDigitizer::Exec(Option_t* /*option*/)
TTree*
AliFMDHitDigitizer::MakeOutputTree(AliLoader* loader)
{
+ /**
+ * Make the output tree using the passed loader
+ *
+ * @param loader
+ * @return The generated tree.
+ */
if (fOutput == kDigits)
return AliFMDBaseDigitizer::MakeOutputTree(loader);
void
AliFMDHitDigitizer::StoreDigits(AliLoader* loader)
{
+ /**
+ * Store the data using the loader
+ *
+ * @param loader The loader
+ */
if (fOutput == kDigits) {
AliFMDBaseDigitizer::StoreDigits(loader);
return;
* 2\mu{}s@f$)
*/
void SetHoldTime(Double_t holdT=2e-6) { fHoldTime = holdT; }
+ /**
+ * Get the hold time
+ *
+ * @return Hold time in seconds
+ */
Double_t GetHoldTime() const { return fHoldTime; }
protected:
/** Copy constructor
fHoldTime(2e-6),
fStack(o.fStack)
{}
- /** Assignment operator
- @param o Object to assign from
- @return Reference to this */
- AliFMDHitDigitizer& operator=(const AliFMDHitDigitizer& o)
- {
- AliFMDBaseDigitizer::operator=(o);
- fHoldTime = o.fHoldTime;
- fOutput = o.fOutput;
- fStack = o.fStack;
- return *this;
- }
- /** Make the output tree using the passed loader
- @param loader
- @return The generated tree. */
+ /**
+ * Assignment operator
+ *
+ * @param o Object to assign from
+ * @return Reference to this
+ */
+ AliFMDHitDigitizer& operator=(const AliFMDHitDigitizer& o);
+ /**
+ * Make the output tree using the passed loader
+ *
+ * @param loader
+ * @return The generated tree.
+ */
TTree* MakeOutputTree(AliLoader* loader);
/** Sum energy deposited contributions from each hit in a cache
@param hitsBranch Branch in input tree */
void CheckDigit(AliFMDDigit* digit,
UShort_t nhits,
const TArrayI& counts);
- /** Store the data using the loader
- @param loader The loader */
+ /**
+ * Store the data using the loader
+ *
+ * @param loader The loader
+ */
void StoreDigits(AliLoader* loader);
-/**************************************************************************
+/*************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* 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 AliFMDParameters.cxx
- @author Christian Holm Christensen <cholm@nbi.dk>
- @date Mon Mar 27 12:44:26 2006
- @brief Manager of FMD parameters
-*/
+ *************************************************************************
+ * $Id$ */
+/**
+ * @file AliFMDParameters.cxx
+ * @author Christian Holm Christensen <cholm@nbi.dk>
+ * @date Mon Mar 27 12:44:26 2006
+ * @brief Manager of FMD parameters
+ */
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers.
AliFMDParameters*
AliFMDParameters::Instance()
{
+ //
// Get static instance
+ //
if (!fgInstance) fgInstance = new AliFMDParameters;
return fgInstance;
}
fAltroMap(0),
fStripRange(0)
{
+ //
// Default constructor
+ //
SetVA1MipRange();
SetAltroChannelSize();
SetChannelsPerAltro();
void
AliFMDParameters::Init(Bool_t forceReInit, UInt_t what)
{
- // Initialize the parameters manager. We need to get stuff from the
- // CDB here.
+ //
+ // Initialize the manager. This tries to read the parameters from
+ // CDB. If that fails, the class uses the hard-coded parameters.
+ //
+ // Parameters:
+ // forceReInit Force (re-)initalize flag
+ // what What to initialize
+ //
if (forceReInit) fIsInit = kFALSE;
if (fIsInit) return;
if (what & kPulseGain) InitPulseGain();
void
AliFMDParameters::Init(AliFMDPreprocessor* pp, Bool_t forceReInit, UInt_t what)
{
- // Initialize the parameters manager. We need to get stuff from the
- // CDB here.
+ //
+ // Initialize the manager. This tries to read the parameters from
+ // CDB. If that fails, the class uses the hard-coded parameters.
+ //
+ // Parameters:
+ // pp Preprocessor
+ // forceReInit Force (re-)initalize flag
+ // what What to initialize
+ //
if (forceReInit) fIsInit = kFALSE;
if (fIsInit) return;
if (what & kPulseGain) InitPulseGain(pp);
int number,
TString& f) const
{
+ //
+ // Check if the file <i>prefix</i><i>number</i> exists in @a path,
+ // and write the full path to @a f.
+ //
+ // Parameters:
+ // prefix File prefix (cond, peds, gains, ...)
+ // path Path to files
+ // number Detector number (1, 2, or 3)
+ // f On return full path to file (if found)
+ //
+ // Return:
+ // @c true if file exists and is readable, @c false otherwise
+ //
f = (Form("%s%d.csv", prefix, number));
AliFMDDebug(5, ("Checking if %s exists in %s ...", f.Data(), path));
f = gSystem->Which(path, f.Data());
void
AliFMDParameters::Init(const char* path, Bool_t forceReInit, UInt_t what)
{
- // Initialize the parameters manager. Pedestals, gains, strip
- // range, and sample rate is read from local comma separated value
- // files if available. Otherwise, the calibrations are obtained
- // from OCDB.
+ //
+ // Initialize the manager. This will try to read some calibrations
+ // (sample rate, strip range, gains, pedestals) from local comma
+ // separated value (CSV) files in the directory pointed at by @a
+ // path. If they are not found, then they will be retrieved from
+ // OCDB as appropriately. Other calibrations are always read from
+ // OCDB.
+ //
+ // The CSV files should be named as
+ //
+ // - Pedestals: <tt>peds</tt><i>det_number</i><tt>.csv</tt>
+ // - Gains: <tt>gains</tt><i>det_number</i><tt>.csv</tt>
+ // - Sample Rate: <tt>conditions</tt><i>det_number</i><tt>.csv</tt>
+ // - Strip Range: <tt>conditions</tt><i>det_number</i><tt>.csv</tt>
+ //
+ // where <i>det_number</i> is the detector number (1, 2, or 3).
+ //
+ // Parameters:
+ // path Where to look for the CSV files
+ // forceReInit Always reinitialise
+ // what What calibrations to load.
+ //
if (forceReInit) fIsInit = kFALSE;
if (fIsInit) return;
Float_t minGain,
Float_t maxGain)
{
+ //
+ // Automatically generate a dead map from the pedestals and gains.
+ // A channel is marked as dead of the noise is too high (currently
+ // more than 10 ADC counts), or the gain is unreasonable (currently
+ // larger than 10, or smaller than 0.1).
+ //
+ // The procedure does not overwrite channels previously marked as
+ // dead - e.g., channels marked as dead in the calibration loaded
+ // from OCDB will continue to be marked as dead. That is, this
+ // procedure will never make a channel un-dead.
+ //
+ // Parameters:
+ // maxNoise Maximum noise value before a channel is marked
+ // as dead.
+ // minGain Minimum value of the calibrated gain before a
+ // channel is considered dead.
+ // maxGain Maximum value of the calibrated gain before a
+ // channel is considered dead.
+ //
if (fPedestal)
fDeadMap = fPedestal->MakeDeadMap(maxNoise, fDeadMap);
if (fPulseGain)
void
AliFMDParameters::Draw(Option_t* option)
{
+ //
+ // Draw parameters.
+ //
+ // Parameters:
+ // 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
+ //
TString opt(option);
enum {
kLocalPulseGain, // Path to PulseGain calib object
}
-//__________________________________________________________________
-void
-AliFMDParameters::SetStripRange(UShort_t min, UShort_t max)
-{
- // Set fixed strip range
- fFixedMinStrip = min;
- fFixedMaxStrip = max;
-}
-
//__________________________________________________________________
AliCDBEntry*
AliFMDParameters::GetEntry(const char* path, AliFMDPreprocessor* pp,
Bool_t fatal) const
{
- // Get an entry from the CDB or via preprocessor
+ //
+ // Get an entry from either global AliCDBManager or passed
+ // AliFMDPreprocessor.
+ //
+ // Parameters:
+ // path Path to CDB object.
+ // pp AliFMDPreprocessor
+ // fatal If true, raise a fatal flag if we didn't get the entry.
+ // Return:
+ // AliCDBEntry if found
+ //
AliCDBEntry* entry = 0;
if (!pp) {
AliCDBManager* cdb = AliCDBManager::Instance();
void
AliFMDParameters::InitPulseGain(AliFMDPreprocessor* pp)
{
- // Get pulse gain from CDB or used fixed
+ //
+ // Initialize gains. Try to get them from CDB
+ //
+ // Parameters:
+ // pp Pre-processor if called from shuttle
+ //
AliCDBEntry* gain = GetEntry(fgkPulseGain, pp);
if (!gain) return;
void
AliFMDParameters::InitPedestal(AliFMDPreprocessor* pp)
{
- // Initialize the pedestals from CDB
+ //
+ // Initialize pedestals. Try to get them from CDB
+ //
+ // Parameters:
+ // pp Pre-processor if called from shuttle
+ //
AliCDBEntry* pedestal = GetEntry(fgkPedestal, pp);
if (!pedestal) return;
void
AliFMDParameters::InitDeadMap(AliFMDPreprocessor* pp)
{
- // Get Dead-channel-map from CDB
+ //
+ // Initialize dead map. Try to get it from CDB
+ //
+ // Parameters:
+ // pp Pre-processor if called from shuttle
+ //
AliCDBEntry* deadMap = GetEntry(fgkDead, pp);
if (!deadMap) return;
void
AliFMDParameters::InitZeroSuppression(AliFMDPreprocessor* pp)
{
- // Get 0-suppression from CDB
+ //
+ // Initialize zero suppression thresholds. Try to get them from CDB
+ //
+ // Parameters:
+ // pp Pre-processor if called from shuttle
+ //
AliCDBEntry* zeroSup = GetEntry(fgkZeroSuppression, pp);
if (!zeroSup) return;
AliFMDDebug(5, ("Got zero suppression from CDB"));
void
AliFMDParameters::InitSampleRate(AliFMDPreprocessor* pp)
{
- // get Sample rate from CDB
+ //
+ // Initialize sample rates. Try to get them from CDB
+ //
+ // Parameters:
+ // pp Pre-processor if called from shuttle
+ //
AliCDBEntry* sampRat = GetEntry(fgkSampleRate, pp);
if (!sampRat) return;
AliFMDDebug(5, ("Got zero suppression from CDB"));
void
AliFMDParameters::InitAltroMap(AliFMDPreprocessor* pp)
{
- // Get hardware mapping from CDB
+ //
+ // Initialize hardware map. Try to get it from CDB
+ //
+ // Parameters:
+ // pp Pre-processor if called from shuttle
+ //
if (fAltroMap) {
delete fAltroMap;
fAltroMap = 0;
void
AliFMDParameters::InitStripRange(AliFMDPreprocessor* pp)
{
- // Get strips read-out from CDB
+ //
+ // Initialize strip range. Try to get it from CDB
+ //
+ // Parameters:
+ // pp Pre-processor if called from shuttle
+ //
AliCDBEntry* range = GetEntry(fgkStripRange, pp);
if (!range) return;
AliFMDDebug(5, ("Got strip range from CDB"));
Float_t
AliFMDParameters::GetThreshold() const
{
- // Get threshold from CDB
+ //
+ // Get the threshold in the pulser gain
+ //
+ //
+ // Return:
+ // Threshold from pulser
+ //
if (!fPulseGain) return fFixedThreshold;
return fPulseGain->Threshold();
}
AliFMDParameters::GetPulseGain(UShort_t detector, Char_t ring,
UShort_t sector, UShort_t strip) const
{
- // Returns the pulser calibrated gain for strip # strip in sector #
- // sector or ring id ring of detector # detector.
//
- // For simulation, this is normally set to
+ // Gain of pre-amp. for strip, sector, ring, detector
+ //
+ // For simulations this is normally set to
+ //
+ // @f[
+ // \frac{\mbox{VA1_MIP_Range}{\mbox{ALTRO_channel_size}}\mbox{MIP_Energy_Loss}
+ // @f]
//
- // VA1_MIP_Range
- // ------------------ * MIP_Energy_Loss
- // ALTRO_channel_size
//
+ // Parameters:
+ // detector Detector # (1-3)
+ // ring Ring ID ('I' or 'O')
+ // sector Sector number (0-39)
+ // strip Strip number (0-511)
+ //
+ // Return:
+ // Gain of pre-amp.
+ //
if (!fPulseGain) {
if (fFixedPulseGain <= 0)
fFixedPulseGain = fVA1MipRange * GetEdepMip() / fAltroChannelSize;
AliFMDParameters::IsDead(UShort_t detector, Char_t ring,
UShort_t sector, UShort_t strip) const
{
- // Check if the channel is dead
+ //
+ // Whether the strip is considered dead
+ //
+ // Parameters:
+ // detector Detector # (1-3)
+ // ring Ring ID ('I' or 'O')
+ // sector Sector number (0-39)
+ // strip Strip number (0-511)
+ //
+ // Return:
+ // @c true if the strip is considered dead, @c false if it's
+ // OK.
+ //
if (!fDeadMap) return kFALSE;
AliFMDDebug(50, ("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
+ //
+ // zero suppression threshold (in ADC counts)
+ //
+ // Parameters:
+ // detector Detector # (1-3)
+ // ring Ring ID ('I' or 'O')
+ // sector Sector number (0-39)
+ // strip Strip number (0-511)
+ //
+ // Return:
+ // zero suppression threshold (in ADC counts)
+ //
if (!fZeroSuppression) return fFixedZeroSuppression;
// Need to map strip to ALTRO chip.
AliFMDDebug(50, ("zero sup. for FMD%d%c[%2d,%3d]=%d",
AliFMDParameters::GetSampleRate(UShort_t det, Char_t ring, UShort_t sector,
UShort_t str) const
{
- // Get sampl rate
+ //
+ // Get the sampling rate
+ //
+ // Parameters:
+ // detector Detector # (1-3)
+ // ring Ring ID ('I' or 'O')
+ // sector Sector number (0-39)
+ // strip Strip number (0-511)
+ //
+ // Return:
+ // The sampling 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
+ //
+ // Get the minimum strip in the read-out range
+ //
+ // Parameters:
+ // detector Detector # (1-3)
+ // ring Ring ID ('I' or 'O')
+ // sector Sector number (0-39)
+ // strip Strip number (0-511)
+ //
+ // Return:
+ // Minimum strip
+ //
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
+ //
+ // Get the maximum strip in the read-out range
+ //
+ // Parameters:
+ // detector Detector # (1-3)
+ // ring Ring ID ('I' or 'O')
+ // sector Sector number (0-39)
+ // strip Strip number (0-511)
+ //
+ // Return:
+ // Maximum strip
+ //
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
+ //
+ // Get mean of pedestal
+ //
+ // Parameters:
+ // detector Detector # (1-3)
+ // ring Ring ID ('I' or 'O')
+ // sector Sector number (0-39)
+ // strip Strip number (0-511)
+ //
+ // Return:
+ // Mean of pedestal
+ //
if (!fPedestal) return fFixedPedestal;
AliFMDDebug(50, ("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
+ //
+ // Width of pedestal
+ //
+ // Parameters:
+ // detector Detector # (1-3)
+ // ring Ring ID ('I' or 'O')
+ // sector Sector number (0-39)
+ // strip Strip number (0-511)
+ //
+ // Return:
+ // Width of pedestal
+ //
if (!fPedestal) return fFixedPedestalWidth;
AliFMDDebug(50, ("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
+ //
+ // Get the map that translates hardware to detector coordinates
+ //
+ // Return:
+ // Get the map that translates hardware to detector
+ // coordinates
+ //
return fAltroMap;
}
UShort_t& sec, Short_t& str,
UShort_t& sam) const
{
- // Translate a hardware address to detector coordinates.
//
- // See also Hardware2Detector that accepts 4 inputs
+ // Map a hardware address into a detector index.
+ //
+ // Parameters:
+ // ddl Hardware DDL number
+ // addr Hardware address.
+ // timebin Timebin
+ // det On return, the detector #
+ // ring On return, the ring ID
+ // sec On return, the sector #
+ // str On return, the base of strip #
+ // sam On return, the sample number for this strip
+ //
+ // Return:
+ // @c true on success, false otherwise
+ //
if (!fAltroMap) return kFALSE;
UShort_t board, chip, chan;
fAltroMap->ChannelAddress(addr, board, chip, chan);
UShort_t& sec, Short_t& str,
UShort_t& sam) const
{
- // Translate a hardware address to detector coordinates.
//
- // See also Hardware2Detector that accepts 4 inputs
+ // Map a hardware address into a detector index.
+ //
+ // Parameters:
+ // ddl Hardware DDL number
+ // board FEC number
+ // altro ALTRO number
+ // channel Channel number
+ // timebin Timebin
+ // det On return, the detector #
+ // ring On return, the ring ID
+ // sec On return, the sector #
+ // str On return, the base of strip #
+ // sam On return, the sample number for this strip
+ //
+ // Return:
+ // @c true on success, false otherwise
+ //
if (!fAltroMap) return kFALSE;
if (fAltroMap->DDL2Detector(ddl) < 0) return kFALSE;
Short_t stripBase = 0;
return kTRUE;
}
-#if 0
-//__________________________________________________________________
-Bool_t
-AliFMDParameters::Hardware2Detector(UShort_t ddl, UShort_t board,
- UShort_t chip, UShort_t chan,
- UShort_t& det, Char_t& ring,
- UShort_t& sec, Short_t& str) const
-{
- // Map hardware address to detector index
- if (!fAltroMap) return kFALSE;
- return fAltroMap->Hardware2Detector(ddl,board,chip,chan, det,ring,sec,str);
-}
-//__________________________________________________________________
-Bool_t
-AliFMDParameters::Hardware2Detector(UShort_t ddl, UShort_t addr,
- UShort_t& det, Char_t& ring,
- UShort_t& sec, Short_t& str) const
-{
- // Map hardware address to detector index
- if (!fAltroMap) return kFALSE;
- return fAltroMap->Hardware2Detector(ddl, addr, det, ring, sec, str);
-}
-#endif
//____________________________________________________________________
Bool_t
UShort_t& altro, UShort_t& channel,
UShort_t& timebin) const
{
+ //
+ // Map a detector index into a hardware address.
+ //
+ // Parameters:
+ // det The detector #
+ // ring The ring ID
+ // sec The sector #
+ // str The strip #
+ // sam The sample number
+ // ddl On return, hardware DDL number
+ // board On return, the FEC board address (local to DDL)
+ // altro On return, the ALTRO number (local to FEC)
+ // channel On return, the channel number (local to ALTRO)
+ // timebin On return, the timebin number (local to ALTRO)
+ //
+ // Return:
+ // @c true on success, false otherwise
+ //
if (!fAltroMap) return kFALSE;
UShort_t preSamples = GetPreSamples(det, ring, sec, str);
UShort_t sampleRate = GetSampleRate(det, ring, sec, str);
UShort_t& ddl, UShort_t& addr,
UShort_t& timebin) const
{
+ //
+ // Map a detector index into a hardware address.
+ //
+ // Parameters:
+ // det The detector #
+ // ring The ring ID
+ // sec The sector #
+ // str The strip #
+ // sam The sample number
+ // ddl On return, hardware DDL number
+ // addr On return, hardware address.
+ // timebin On return, the timebin number (local to ALTRO)
+ //
+ // Return:
+ // @c true on success, false otherwise
+ //
if (!fAltroMap) return kFALSE;
UShort_t preSamples = GetPreSamples(det, ring, sec, str);
UShort_t sampleRate = GetSampleRate(det, ring, sec, str);
ddl, addr, timebin);
}
-#if 0
-//__________________________________________________________________
-Bool_t
-AliFMDParameters::Detector2Hardware(UShort_t det, Char_t ring,
- UShort_t sec, UShort_t str,
- UShort_t& ddl, UShort_t& board,
- UShort_t& chip, UShort_t& chan) const
-{
- // Map detector index to hardware address
- if (!fAltroMap) return kFALSE;
- return fAltroMap->Detector2Hardware(det,ring,sec,str, ddl,board,chip,chan);
-}
-
-//__________________________________________________________________
-Bool_t
-AliFMDParameters::Detector2Hardware(UShort_t det, Char_t ring,
- UShort_t sec, UShort_t str,
- UShort_t& ddl, UShort_t& addr) const
-{
- // Map detector index to hardware address
- if (!fAltroMap) return kFALSE;
- return fAltroMap->Detector2Hardware(det, ring, sec, str, ddl, addr);
-}
-#endif
//__________________________________________________________________
Float_t
AliFMDParameters::GetEdepMip() const
{
- // Get energy deposited by a MIP in the silicon sensors
+ //
+ // Return:
+ // The average energy deposited by one MIP
+ //
if (fEdepMip <= 0){
AliFMDGeometry* fmd = AliFMDGeometry::Instance();
fEdepMip = (fkSiDeDxMip
Float_t
AliFMDParameters::GetDACPerMIP() const
{
- //This is the conversion from the Digital-to-Analog-Converter setting
+ //
+ // This is the conversion from Digital-to-Analog-Converter setting
// to the number of MIPs. The number was measured in the NBI lab during
// August 2008.
-
+ //
+ // Return:
+ // The conversion factor from DAC to ADC
+ //
return 29.67;
}
#ifndef ROOT_TArrayI
# include <TArrayI.h>
#endif
-#ifndef ALIFMDUSHORTMAP_H
-# include <AliFMDUShortMap.h>
-#endif
-#ifndef ALIFMDBOOLMAP_H
-# include <AliFMDBoolMap.h>
-#endif
-typedef AliFMDUShortMap AliFMDCalibZeroSuppression;
-typedef AliFMDBoolMap AliFMDCalibDeadMap;
-class AliFMDCalibPedestal;
-class AliFMDCalibGain;
-class AliFMDCalibSampleRate;
-class AliFMDCalibStripRange;
-class AliFMDAltroMapping;
+#include "AliFMDCalibFwd.h"
class AliCDBEntry;
class AliFMDPreprocessor;
kZeroSuppression|kAltroMap|kStripRange)
};
- /** Singleton access
- @return single to */
+ /**
+ * Singleton access
+ *
+ *
+ * @return singleton
+ */
static AliFMDParameters* Instance();
- /** Initialize the manager. This tries to read the parameters from
- CDB. If that fails, the class uses the hard-coded parameters.
+ /**
+ * Initialize the manager. This tries to read the parameters from
+ * CDB. If that fails, the class uses the hard-coded parameters.
+ *
+ * @param forceReInit Force (re-)initalize flag
+ * @param what What to initialize
*/
void Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll );
- /** Initialize the manager. This tries to read the parameters from
- CDB. If that fails, the class uses the hard-coded parameters.
+ /**
+ * Initialize the manager. This tries to read the parameters from
+ * CDB. If that fails, the class uses the hard-coded parameters.
+ *
+ * @param pp Preprocessor
+ * @param forceReInit Force (re-)initalize flag
+ * @param what What to initialize
*/
void Init(AliFMDPreprocessor* pp,
Bool_t forceReInit=kFALSE,
* channel is considered dead.
*/
void MakeDeadMap(Float_t maxNoise=10, Float_t minGain=.1, Float_t maxGain=10);
- /** Print all parameters.
- @param option Option string */
+ /**
+ * Print all parameters.
+ *
+ * If option contains an 'A' then everything is printed.
+ *
+ * If the option contains the string "FMD" the function will search
+ * for detector, ring, sector, and strip numbers to print, in
+ * format
+ *
+ * @verbatim
+ * FMD<detector><ring>[<sector>,<string>]
+ * @endverbatim
+ *
+ * The wild card '*' means all of <detector>, <ring>, <sector>, or
+ * <strip>.
+ *
+ * @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
- */
+ /**
+ * 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 */
- /** @param r How many MIP signals we can fit in the VA1
- pre-amps. (default and design is 20) */
+ /**
+ * @param r How many MIP signals we can fit in the VA1
+ * pre-amps. (default and design is 20)
+ */
void SetVA1MipRange(UShort_t r=20) { fVA1MipRange = r; }
- /** @param s Maximum number of the ADC (ALTRO). This is a 10 bit
- ADC so, the maximum number is 1024 */
+ /**
+ * @param s Maximum number of the ADC (ALTRO). This is a 10 bit
+ * ADC so, the maximum number is 1024
+ */
void SetAltroChannelSize(UShort_t s=1024) { fAltroChannelSize = s;}
- /** @param size The number of strips multiplexed into one ALTRO
- channel. That is, how many strips is connected to one VA1
- pre-amp. */
+ /**
+ * @param size The number of strips multiplexed into one ALTRO
+ * channel. That is, how many strips is connected to one VA1
+ * pre-amp.
+ */
void SetChannelsPerAltro(UShort_t size=128) { fChannelsPerAltro = size; }
- /** @param f Factor to use for accepting a signal. */
+ /**
+ * @param f Factor to use for accepting a signal.
+ */
void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; }
- /** @param n Number of pre-samples to keep during zero-suppression -
- only used in simulation. */
+ /**
+ * @param n Number of pre-samples to keep during zero-suppression -
+ * only used in simulation.
+ */
void SetZSPreSamples(UShort_t n=1) { fZSPre = (n & 0x3); }
- /** @param n Number of post-samples to keep during zero-suppression -
- only used in simulation. */
+ /**
+ * @param n Number of post-samples to keep during zero-suppression -
+ * only used in simulation.
+ */
void SetZSPostSamples(UShort_t n=1) { fZSPost = (n & 0x3); }
- /** @param use If true, do pedestal subtraction before zero
- suppression - only used in simulation */
+ /**
+ * @param use If true, do pedestal subtraction before zero
+ * suppression - only used in simulation
+ */
void SetZSPedSubtract(Bool_t use=kTRUE) { fZSPedSubtract = use; }
/** @} */
/** @{ */
/** @name Set various variable parameter defaults */
- /** @param s Zero suppression threshold in ADC counts */
+ /**
+ * @param s Zero suppression threshold in ADC counts
+ */
void SetZeroSuppression(UShort_t s=0) { fFixedZeroSuppression = s; }
- /** @param r How many times we oversample each strip. */
+ /**
+ * @param r How many times we oversample each strip.
+ */
void SetSampleRate(UShort_t r=1) { fFixedSampleRate = r ;}//(r>2?2:r);}
+ /**
+ * @param r How many times we oversample each strip.
+ */
void SetSampleRate(AliFMDCalibSampleRate* r) { fSampleRate = r; }
- /** @param p Pedestal value in ADC counts */
+ /**
+ * @param p Pedestal value in ADC counts
+ */
void SetPedestal(Float_t p=10) { fFixedPedestal = p; }
- /** @param p Pedestal map */
+ /**
+ * @param p Pedestal map
+ */
void SetPedestal(AliFMDCalibPedestal* p) { fPedestal = p; }
- /** @param w Pedestal width in ADC counts */
+ /**
+ * @param w Pedestal width in ADC counts
+ */
void SetPedestalWidth(Float_t w=1) { fFixedPedestalWidth = w; }
- /** @param t Threshold used for 1 MIP acceptance. */
+ /**
+ * @param t Threshold used for 1 MIP acceptance.
+ */
void SetThreshold(Float_t t=0) { fFixedThreshold = t; }
- /** Range of strips read out
- @param min Minimum strip number (0-127).
- @param max Maximum strip number (0-127). */
+ /**
+ * Range of strips read out
+ *
+ * @param min Minimum strip number (0-127).
+ * @param max Maximum strip number (0-127).
+ */
void SetStripRange(UShort_t min=0, UShort_t max=127);
+ /**
+ * set the strip range from object
+ *
+ * @param r Strip range object
+ */
void SetStripRange(AliFMDCalibStripRange* r) { fStripRange = r; }
- /** Whether raw data has full common data header (8 32bit words) or
- the older invalid format (7 32bit words with bogus entries)
- @param yes if true the raw data has complete data header */
+ /**
+ * Whether raw data has full common data header (8 32bit words) or
+ * the older invalid format (7 32bit words with bogus entries)
+ *
+ * @param yes if true the raw data has complete data header
+ */
void UseCompleteHeader(Bool_t yes=kTRUE) { fHasCompleteHeader = yes; }
- /** @param g Gain map */
+ /**
+ * @param g Gain map
+ */
void SetGain(AliFMDCalibGain* g) { fPulseGain = g; }
/** @} */
/** @{ */
/** @name Get `Fixed' various parameters */
- /** @return Number of MIP signals that fit inside a VA1 channel */
+ /**
+ * @return Number of MIP signals that fit inside a VA1 channel
+ */
UShort_t GetVA1MipRange() const { return fVA1MipRange; }
- /** @return The maximum count in the ADC */
+ /**
+ * @return The maximum count in the ADC
+ */
UShort_t GetAltroChannelSize() const { return fAltroChannelSize; }
- /** @return Number of strips muliplexed into one ADC channel */
+ /**
+ * @return Number of strips muliplexed into one ADC channel
+ */
UShort_t GetChannelsPerAltro() const { return fChannelsPerAltro; }
- /** @return The average energy deposited by one MIP */
+ /**
+ * @return The average energy deposited by one MIP
+ */
Float_t GetEdepMip() const;
- /** @return The conversion factor from DAC to ADC */
+ /**
+ * This is the conversion from Digital-to-Analog-Converter setting
+ * to the number of MIPs. The number was measured in the NBI lab during
+ * August 2008.
+ *
+ * @return The conversion factor from DAC to ADC
+ */
Float_t GetDACPerMIP() const;
- /** @return The factor used of signal acceptance */
+ /**
+ * @return The factor used of signal acceptance
+ */
Float_t GetPedestalFactor() const { return fPedestalFactor; }
- /** @param n Number of pre-samples to keep during zero-suppression -
- only used in simulation. */
+ /**
+ * @param n Number of pre-samples to keep during zero-suppression -
+ * only used in simulation.
+ */
UShort_t GetZSPreSamples() const { return fZSPre; }
- /** @param n Number of post-samples to keep during zero-suppression -
- only used in simulation. */
+ /**
+ * @param n Number of post-samples to keep during zero-suppression -
+ * only used in simulation.
+ */
UShort_t GetZSPostSamples() const { return fZSPost; }
- /** @param use If true, do pedestal subtraction before zero
- suppression - only used in simulation */
+ /**
+ * @param use If true, do pedestal subtraction before zero
+ * suppression - only used in simulation
+ */
Bool_t IsZSPedSubtract() const { return fZSPedSubtract; }
/** @} */
-
+
/** @{ */
/** @name Various varible conditions */
- /** Whether the strip is considered dead
- @param detector Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sector Sector number (0-39)
- @param strip Strip number (0-511)
- @return @c true if the strip is considered dead, @c false if
- it's OK. */
+ /**
+ * Whether the strip is considered dead
+ *
+ * @param detector Detector # (1-3)
+ * @param ring Ring ID ('I' or 'O')
+ * @param sector Sector number (0-39)
+ * @param strip Strip number (0-511)
+ *
+ * @return @c true if the strip is considered dead, @c false if it's
+ * OK.
+ */
Bool_t IsDead(UShort_t detector,
Char_t ring,
UShort_t sector,
UShort_t strip) const;
+ /**
+ * Get the threshold in the pulser gain
+ *
+ *
+ * @return Threshold from pulser
+ */
Float_t GetThreshold() const;
- /** Gain of pre-amp.
- @param detector Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sector Sector number (0-39)
- @param strip Strip number (0-511)
- @return Gain of pre-amp. */
+ /**
+ * Gain of pre-amp. for strip, sector, ring, detector
+ *
+ * For simulations this is normally set to
+ *
+ * @f[
+ * \frac{\mbox{VA1_MIP_Range}{\mbox{ALTRO_channel_size}}\mbox{MIP_Energy_Loss}
+ * @f]
+ *
+ *
+ * @param detector Detector # (1-3)
+ * @param ring Ring ID ('I' or 'O')
+ * @param sector Sector number (0-39)
+ * @param strip Strip number (0-511)
+ *
+ * @return Gain of pre-amp.
+ */
Float_t GetPulseGain(UShort_t detector,
Char_t ring,
UShort_t sector,
UShort_t strip) const;
- /** Get mean of pedestal
- @param detector Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sector Sector number (0-39)
- @param strip Strip number (0-511)
- @return Mean of pedestal */
+ /**
+ * Get mean of pedestal
+ *
+ * @param detector Detector # (1-3)
+ * @param ring Ring ID ('I' or 'O')
+ * @param sector Sector number (0-39)
+ * @param strip Strip number (0-511)
+ *
+ * @return Mean of pedestal
+ */
Float_t GetPedestal(UShort_t detector,
Char_t ring,
UShort_t sector,
UShort_t strip) const;
- /** Width of pedestal
- @param detector Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sector Sector number (0-39)
- @param strip Strip number (0-511)
- @return Width of pedestal */
+ /**
+ * Width of pedestal
+ *
+ * @param detector Detector # (1-3)
+ * @param ring Ring ID ('I' or 'O')
+ * @param sector Sector number (0-39)
+ * @param strip Strip number (0-511)
+ *
+ * @return Width of pedestal
+ */
Float_t GetPedestalWidth(UShort_t detector,
Char_t ring,
UShort_t sector,
UShort_t strip) const;
- /** zero suppression threshold (in ADC counts)
- @param detector Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sector Sector number (0-39)
- @param strip Strip number (0-511)
- @return zero suppression threshold (in ADC counts) */
+ /**
+ * zero suppression threshold (in ADC counts)
+ *
+ * @param detector Detector # (1-3)
+ * @param ring Ring ID ('I' or 'O')
+ * @param sector Sector number (0-39)
+ * @param strip Strip number (0-511)
+ *
+ * @return zero suppression threshold (in ADC counts)
+ */
UShort_t GetZeroSuppression(UShort_t detector,
Char_t ring,
UShort_t sector,
UShort_t strip) const;
- /** Get the sampling rate
- @param detector Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sector Sector number (0-39)
- @param strip Strip number (0-511)
- @return The sampling rate */
+ /**
+ * Get the sampling rate
+ *
+ * @param detector Detector # (1-3)
+ * @param ring Ring ID ('I' or 'O')
+ * @param sector Sector number (0-39)
+ * @param strip Strip number (0-511)
+ *
+ * @return The sampling rate
+ */
UShort_t GetSampleRate(UShort_t detector,
Char_t ring,
UShort_t sector,
UShort_t strip) const;
- /** Get the minimum strip in the read-out range
- @param detector Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sector Sector number (0-39)
- @param strip Strip number (0-511)
- @return Minimum strip */
+ /**
+ * Get the minimum strip in the read-out range
+ *
+ * @param detector Detector # (1-3)
+ * @param ring Ring ID ('I' or 'O')
+ * @param sector Sector number (0-39)
+ * @param strip Strip number (0-511)
+ *
+ * @return Minimum strip
+ */
UShort_t GetMinStrip(UShort_t detector,
Char_t ring,
UShort_t sector,
UShort_t strip) const;
- /** Get the maximum strip in the read-out range
- @param detector Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sector Sector number (0-39)
- @param strip Strip number (0-511)
- @return Maximum strip */
+ /**
+ * Get the maximum strip in the read-out range
+ *
+ * @param detector Detector # (1-3)
+ * @param ring Ring ID ('I' or 'O')
+ * @param sector Sector number (0-39)
+ * @param strip Strip number (0-511)
+ *
+ * @return Maximum strip
+ */
UShort_t GetMaxStrip(UShort_t detector,
Char_t ring,
UShort_t sector,
UShort_t strip) const;
- /** Get the number of pre-samples in ALTRO channels
- @param detector Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sector Sector number (0-39)
- @param strip Strip number (0-511)
- @return Maximum strip */
+ /**
+ * Get the number of pre-samples in ALTRO channels
+ *
+ * @param detector Detector # (1-3)
+ * @param ring Ring ID ('I' or 'O')
+ * @param sector Sector number (0-39)
+ * @param strip Strip number (0-511)
+ *
+ * @return Maximum strip
+ */
UShort_t GetPreSamples(UShort_t,
Char_t,
UShort_t,
UShort_t) const { return 14+5; }
- /** @} */
+ /* @}*/
- /** @{
- @name Hardware to detector translation (and inverse) */
- /** Map a hardware address into a detector index.
- @param ddl Hardware DDL number
- @param board FEC number
- @param altro ALTRO number
- @param channel Channel number
- @param timebin Timebin
- @param det On return, the detector #
- @param ring On return, the ring ID
- @param sec On return, the sector #
- @param str On return, the base of strip #
- @param sam On return, the sample number for this strip
- @return @c true on success, false otherwise */
+ /**
+ * @{
+ * @name Hardware to detector translation (and inverse)
+ */
+ /**
+ * Map a hardware address into a detector index.
+ *
+ * @param ddl Hardware DDL number
+ * @param board FEC number
+ * @param altro ALTRO number
+ * @param channel Channel number
+ * @param timebin Timebin
+ * @param det On return, the detector #
+ * @param ring On return, the ring ID
+ * @param sec On return, the sector #
+ * @param str On return, the base of strip #
+ * @param sam On return, the sample number for this strip
+ *
+ * @return @c true on success, false otherwise
+ */
Bool_t Hardware2Detector(UShort_t ddl, UShort_t board,
UShort_t altro, UShort_t chan,
UShort_t timebin,
UShort_t& det, Char_t& ring,
UShort_t& sec, Short_t& str,
UShort_t& sam) const;
- /** Map a hardware address into a detector index.
- @param ddl Hardware DDL number
- @param hwaddr Hardware address.
- @param timebin Timebin
- @param det On return, the detector #
- @param ring On return, the ring ID
- @param sec On return, the sector #
- @param str On return, the base of strip #
- @param sam On return, the sample number for this strip
- @return @c true on success, false otherwise */
+ /**
+ * Map a hardware address into a detector index.
+ *
+ * @param ddl Hardware DDL number
+ * @param hwaddr Hardware address.
+ * @param timebin Timebin
+ * @param det On return, the detector #
+ * @param ring On return, the ring ID
+ * @param sec On return, the sector #
+ * @param str On return, the base of strip #
+ * @param sam On return, the sample number for this strip
+ *
+ * @return @c true on success, false otherwise
+ */
Bool_t Hardware2Detector(UShort_t ddl, UShort_t hwaddr,
UShort_t timebin,
UShort_t& det, Char_t& ring,
UShort_t& sec, Short_t& str,
UShort_t& sam) const;
-#if 0
- /** Translate hardware address to detector coordinates
- @param ddl DDL number
- @param board Board address
- @param chip Chip #
- @param channel Channel #
- @param det On return, Detector # (1-3)
- @param ring On return, Ring ID ('I' or 'O')
- @param sec On return, Sector number (0-39)
- @param str On return, Strip number (0-511)
- @return @c true on success. */
- Bool_t Hardware2Detector(UShort_t ddl, UShort_t board,
- UShort_t chip, UShort_t channel,
- UShort_t& det, Char_t& ring,
- UShort_t& sec, Short_t& str) const;
- /** Translate hardware address to detector coordinates
- @param ddl DDL number
- @param addr Hardware address
- @param det On return, Detector # (1-3)
- @param ring On return, Ring ID ('I' or 'O')
- @param sec On return, Sector number (0-39)
- @param str On return, Strip number (0-511)
- @return @c true on success. */
- Bool_t Hardware2Detector(UShort_t ddl, UShort_t addr, UShort_t& det,
- Char_t& ring, UShort_t& sec, Short_t& str) const;
-#endif
- /** Map a detector index into a hardware address.
- @param det The detector #
- @param ring The ring ID
- @param sec The sector #
- @param str The strip #
- @param sam The sample number
- @param ddl On return, hardware DDL number
- @param board On return, the FEC board address (local to DDL)
- @param altro On return, the ALTRO number (local to FEC)
- @param channel On return, the channel number (local to ALTRO)
- @param timebin On return, the timebin number (local to ALTRO)
- @return @c true on success, false otherwise */
+ /**
+ * Map a detector index into a hardware address.
+ *
+ * @param det The detector #
+ * @param ring The ring ID
+ * @param sec The sector #
+ * @param str The strip #
+ * @param sam The sample number
+ * @param ddl On return, hardware DDL number
+ * @param board On return, the FEC board address (local to DDL)
+ * @param altro On return, the ALTRO number (local to FEC)
+ * @param channel On return, the channel number (local to ALTRO)
+ * @param timebin On return, the timebin number (local to ALTRO)
+ *
+ * @return @c true on success, false otherwise
+ */
Bool_t Detector2Hardware(UShort_t det, Char_t ring,
UShort_t sec, UShort_t str,
UShort_t sam,
UShort_t& ddl, UShort_t& board,
UShort_t& altro, UShort_t& channel,
UShort_t& timebin) const;
- /** Map a detector index into a hardware address.
- @param det The detector #
- @param ring The ring ID
- @param sec The sector #
- @param str The strip #
- @param sam The sample number
- @param ddl On return, hardware DDL number
- @param hwaddr On return, hardware address.
- @param timebin On return, the timebin number (local to ALTRO)
- @return @c true on success, false otherwise */
+ /**
+ * Map a detector index into a hardware address.
+ *
+ * @param det The detector #
+ * @param ring The ring ID
+ * @param sec The sector #
+ * @param str The strip #
+ * @param sam The sample number
+ * @param ddl On return, hardware DDL number
+ * @param hwaddr On return, hardware address.
+ * @param timebin On return, the timebin number (local to ALTRO)
+ *
+ * @return @c true on success, false otherwise
+ */
Bool_t Detector2Hardware(UShort_t det, Char_t ring,
UShort_t sec, UShort_t str,
UShort_t sam,
UShort_t& ddl, UShort_t& hwaddr,
UShort_t& timebin) const;
-#if 0
- /** Translate detector coordinates to hardware address
- @param det Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sec Sector number (0-39)
- @param str Strip number (0-511)
- @param ddl On return, DDL number
- @param board On return, Board address
- @param chip On return, Chip #
- @param channel On return, Channel #
- @return @c true on success. */
- Bool_t Detector2Hardware(UShort_t det, Char_t ring,
- UShort_t sec, UShort_t str,
- UShort_t& ddl, UShort_t& board,
- UShort_t& chip, UShort_t& channel) const;
- /** Translate detector coordinates to hardware address
- @param det Detector # (1-3)
- @param ring Ring ID ('I' or 'O')
- @param sec Sector number (0-39)
- @param str Strip number (0-511)
- @param ddl On return, DDL number
- @param addr On return, Hardware address
- @return @c true on success. */
- Bool_t Detector2Hardware(UShort_t det, Char_t ring, UShort_t sec,
- UShort_t str, UShort_t& ddl, UShort_t& addr) const;
-#endif
- /** Get the map that translates hardware to detector coordinates
- @return Get the map that translates hardware to detector
- coordinates */
+ /**
+ * Get the map that translates hardware to detector coordinates
+ *
+ * @return Get the map that translates hardware to detector
+ * coordinates
+ */
AliFMDAltroMapping* GetAltroMap() const;
- /** Whether raw data has full common data header (8 32bit words) or
- the older invalid format (7 32bit words with bogus entries)
- @return false if the raw data has incomplete data header */
+ /**
+ * Whether raw data has full common data header (8 32bit words) or
+ * the older invalid format (7 32bit words with bogus entries)
+ *
+ * @return false if the raw data has incomplete data header
+ */
Bool_t HasCompleteHeader() const { return fHasCompleteHeader; }
/** @} */
static const char* GetConditionsShuttleID() {return fkConditionsShuttleID;}
protected:
- /** CTOR */
+ /**
+ * CTOR
+ */
AliFMDParameters();
- /** CTOR */
+ /**
+ * CTOR
+ */
AliFMDParameters(const AliFMDParameters& o)
: TNamed(o),
fIsInit(o.fIsInit),
fAltroMap(o.fAltroMap),
fStripRange(o.fStripRange)
{}
- /** Assignement operator
- @return Reference to this */
+ /**
+ * Assignement operator
+ *
+ * @return Reference to this
+ */
AliFMDParameters& operator=(const AliFMDParameters&) { return *this; }
- /** DTOR */
+ /**
+ * DTOR
+ */
virtual ~AliFMDParameters() {}
- /** Singleton instance */
+ /**
+ * Singleton instance
+ */
static AliFMDParameters* fgInstance; // Static singleton instance
/**
* Check if the file <i>prefix</i><i>number</i> exists in @a path,
*/
Bool_t CheckFile(const char* prefix, const char* path,
int number, TString& f) const;
- /** Get an entry from either global AliCDBManager or passed
- AliFMDPreprocessor.
- @param path Path to CDB object.
- @param pp AliFMDPreprocessor
- @param fatal If true, raise a fatal flag if we didn't get the entry.
- @return AliCDBEntry if found */
+ /**
+ * Get an entry from either global AliCDBManager or passed
+ * AliFMDPreprocessor.
+ *
+ * @param path Path to CDB object.
+ * @param pp AliFMDPreprocessor
+ * @param fatal If true, raise a fatal flag if we didn't get the entry.
+ * @return AliCDBEntry if found
+ */
AliCDBEntry* GetEntry(const char* path, AliFMDPreprocessor* pp,
Bool_t fatal=kTRUE) const;
- /** Initialize gains. Try to get them from CDB */
+ /**
+ * Initialize gains. Try to get them from CDB
+ *
+ * @param pp Pre-processor if called from shuttle
+ */
void InitPulseGain(AliFMDPreprocessor* pp=0);
- /** Initialize pedestals. Try to get them from CDB */
+ /**
+ * Initialize pedestals. Try to get them from CDB
+ *
+ * @param pp Pre-processor if called from shuttle
+ */
void InitPedestal(AliFMDPreprocessor* pp=0);
- /** Initialize dead map. Try to get it from CDB */
+ /**
+ * Initialize dead map. Try to get it from CDB
+ *
+ * @param pp Pre-processor if called from shuttle
+ */
void InitDeadMap(AliFMDPreprocessor* pp=0);
- /** Initialize sample rates. Try to get them from CDB */
+ /**
+ * Initialize sample rates. Try to get them from CDB
+ *
+ * @param pp Pre-processor if called from shuttle
+ */
void InitSampleRate(AliFMDPreprocessor* pp=0);
- /** Initialize zero suppression thresholds. Try to get them from CDB */
+ /**
+ * Initialize zero suppression thresholds. Try to get them from CDB
+ *
+ * @param pp Pre-processor if called from shuttle
+ */
void InitZeroSuppression(AliFMDPreprocessor* pp=0);
- /** Initialize hardware map. Try to get it from CDB */
+ /**
+ * Initialize hardware map. Try to get it from CDB
+ *
+ * @param pp Pre-processor if called from shuttle
+ */
void InitAltroMap(AliFMDPreprocessor* pp=0);
- /** Initialize strip range. Try to get it from CDB */
+ /**
+ * Initialize strip range. Try to get it from CDB
+ *
+ * @param pp Pre-processor if called from shuttle
+ */
void InitStripRange(AliFMDPreprocessor* pp=0);
Bool_t fIsInit; // Whether we've been initialised
ClassDef(AliFMDParameters,6) // Manager of parameters
};
+//__________________________________________________________________
+inline void
+AliFMDParameters::SetStripRange(UShort_t min, UShort_t max)
+{
+ // Set fixed strip range
+ fFixedMinStrip = min;
+ fFixedMaxStrip = max;
+}
+
#endif
//____________________________________________________________________
//
#include "AliESDVertex.h"
// #include <AliLog.h>
#include "AliFMDDebug.h" // Better debug macros
+// #include "AliPhysicsSelection.h"
class AliFMDDetector;
//____________________________________________________________________
//____________________________________________________________________
void
-AliFMDPattern::AliFMDPatternDetector::DrawShape(TObjArray& a)
+AliFMDPattern::AliFMDPatternDetector::DrawShape(const TObjArray& a)
{
// Draw all shapes.
//
//____________________________________________________________________
void
-AliFMDPattern::AliFMDPatternDetector::CopyShapes(TObjArray& src,
+AliFMDPattern::AliFMDPatternDetector::CopyShapes(const TObjArray& src,
TObjArray& dest,
Double_t ang,
Double_t fx,
Double_t fy)
{
+ //
+ // Copy shapes
+ //
+ // Parameters:
+ // input Source
+ // own Ours
+ // ang Angle
+ // fx Factor x
+ // fy Factor y
+ //
TIter next(&src);
TGraph* g = 0;
while ((g = static_cast<TGraph*>(next()))) {
// X,Y,Z Coordiantes
// MAX Maximum value.
//
- /** Sigh, for some odd reason, the code-checker does not recognise
- this a usage of the TMath namespace declaration! Idiot */
+ // Sigh, for some odd reason, the code-checker does not recognise
+ // this a usage of the TMath namespace declaration! Idiot
+ //
Int_t i = TMath::Min(Int_t(fCounts.fN * s / max),
Int_t(fGraphs.GetEntries()-1));
if (i < 0 || i >= fCounts.fN) {
fTotal(.2, .35, "Total: "),
fFMD1Area(0),
fFMD2Area(0),
- fFMD3Area(0),
- fPhysicsSelection(0)
+ fFMD3Area(0)// ,fPhysicsSelection(0)
{
// Constructor.
//
SetName("AliFMDPattern");
SetName("2D display of FMD data");
- fPhysicsSelection = new AliPhysicsSelection();
+ // fPhysicsSelection = new AliPhysicsSelection();
// RemoveLoad(kGeometry);
fEvent.SetBit(TLatex::kTextNDC);
fFMD1Sum.SetBit(TLatex::kTextNDC);
fFMD2.Clear();
fFMD3.Clear();
+#if 0
TString triggers = fESDEvent->GetFiredTriggerClasses();
const AliESDVertex* vertex = fESDEvent->GetPrimaryVertexSPD();
Double_t vertexXYZ[3];
const AliMultiplicity* mult = fESDEvent->GetMultiplicity();
Int_t nTrackLets = mult->GetNumberOfTracklets();
std::cout<<triggers.Data()<<" "<<fPhysicsSelection->IsCollisionCandidate(fESDEvent)<<" "<<nTrackLets<<" "<<vertexXYZ[0]<<" "<<vertexXYZ[1]<<" "<<vertexXYZ[2]<<std::endl;
-
+#endif
return AliFMDInput::Begin(event);
}
#include <TObjArray.h>
// #include <TGraph.h>
#include <TLatex.h>
-#include "AliPhysicsSelection.h"
#include <TLine.h>
+// class AliPhysicsSelection;
class TCanvas;
class TPad;
class TH2;
TObjArray& outers);
/** Draw everything
@param a Array of shapes to draw */
- void DrawShape(TObjArray& a);
+ void DrawShape(const TObjArray& a);
/** Add a marker at specified coordinates
@param X X coordinate
@param Y Y coordinate
@param Z Z coordinate
@param max The maximum value to scale to */
void AddMarker(Double_t x, Double_t y, Float_t s, Float_t max);
- Int_t fId; // Identifier #
- TArrayI fCounts; // Number of counts at each level
- TObjArray fGraphs; // Array of graphs - one for each level
- TH2* fFrame; // The mother frame
+ /**
+ * Get the indentifier
+ *
+ * @return Identifier
+ */
+ Int_t GetId() const { return fId; }
+ /**
+ * Get the counts array. Number of counts at each level
+ *
+ * @return Counts array
+ */
+ TArrayI& GetCounts() { return fCounts; }
+ /**
+ * Get the counts array. Number of counts at each level
+ *
+ * @return Counts array
+ */
+ const TArrayI& GetCounts() const { return fCounts; }
+ /**
+ * Get the list of graphs
+ *
+ * @return Array of graphs - one for each level
+ */
+ TObjArray& GetGraphs() { return fGraphs; }
+ /**
+ * Get the list of graphs
+ *
+ * @return Array of graphs - one for each level
+ */
+ const TObjArray& GetGraphs() const { return fGraphs; }
+ /**
+ * Get the mother frame
+ *
+ * @return The mother frame
+ */
+ TH2*& GetFrame() { return fFrame; }
+ /**
+ * Get the mother frame
+ *
+ * @return The mother frame
+ */
+ const TH2* GetFrame() const { return fFrame; }
private:
- /** Copy constructor
- - Not implemented. */
+ /**
+ * Copy constructor
+ * - Not implemented.
+ */
AliFMDPatternDetector(const AliFMDPatternDetector&);
- /** Assignement operator
- -- Not implemented */
+ /**
+ * Assignement operator
+ * -- Not implemented
+ */
AliFMDPatternDetector& operator=(const AliFMDPatternDetector&);
- void CopyShapes(TObjArray& input, TObjArray& own,
+ /**
+ * Copy shapes
+ *
+ * @param input Source
+ * @param own Ours
+ * @param ang Angle
+ * @param fx Factor x
+ * @param fy Factor y
+ */
+ void CopyShapes(const TObjArray& input, TObjArray& own,
Double_t ang=0, Double_t fx=1, Double_t fy=1);
- /** Our own cache of shapes */
- TObjArray fInners;
- /** Our own cache of shapes */
- TObjArray fOuters;
+ Int_t fId; // Identifier #
+ TArrayI fCounts; // Number of counts at each level
+ TObjArray fGraphs; // Array of graphs - one for each level
+ TH2* fFrame; // The mother frame
+ TObjArray fInners; // Our own cache of shapes
+ TObjArray fOuters; // Our own cache of shapes
};
virtual void Redisplay();
/** Called at the end. */
virtual void AtEnd();
- /** Graph to show shape of inner sensor */
TObjArray fInners; // Graph to show shape of inner sensor
- /** Graph to show shape of outer sensor */
TObjArray fOuters; // Graph to show shape of outer sensor
- /** Max inner radius */
Float_t fInnerMax; // Max inner radius
- /** Max outer radius */
Float_t fOuterMax; // Max outer radius
- /** FMD1 Pad */
TPad* fFMD1Pad; // FMD1 Pad
- /** FMD1 Frame */
AliFMDPatternDetector fFMD1; // FMD1 Frame
- /** FMD2 Pad */
TPad* fFMD2Pad; // FMD2 Pad
- /** FMD2 Frame */
AliFMDPatternDetector fFMD2; // FMD2 Frame
- /** FMD3 Pad */
TPad* fFMD3Pad; // FMD3 Pad
- /** FMD3 Frame */
AliFMDPatternDetector fFMD3; // FMD3 Frame
- /** Summary pad */
TPad* fSummary; // Summary pad
- /** Text fields */
TLatex fEvent; // Text fields
TLatex fFMD1Sum; // Total in FMD1
- TLatex fFMD2Sum; // Total in FMD1
- TLatex fFMD3Sum; // Total in FMD1
+ TLatex fFMD2Sum; // Total in FMD2
+ TLatex fFMD3Sum; // Total in FMD3
TLine fLine; // Just a line
TLatex fTotal; // Total in FMD
- Double_t fFMD1Area; //
- Double_t fFMD2Area; //
- Double_t fFMD3Area; //
+ Double_t fFMD1Area; // estimated FMD1 area
+ Double_t fFMD2Area; // estimated FMD2 area
+ Double_t fFMD3Area; // estimated FMD3 area
- AliPhysicsSelection* fPhysicsSelection;
+ // AliPhysicsSelection* fPhysicsSelection;
ClassDef(AliFMDPattern,0) // Display FMD data as hit-patterns.
};
#include "AliFMDPedestalDA.h"
#include "AliFMDAltroMapping.h"
+#include "AliFMDParameters.h"
+#include "AliFMDCalibPedestal.h"
+#include "AliFMDDigit.h"
+#include "AliLog.h"
#include <iostream>
#include <fstream>
#include <iomanip>
-#include "AliLog.h"
-#include "TF1.h"
-#include "TObject.h"
-#include "TMath.h"
+#include <TFile.h>
+#include <TF1.h>
+#include <TObject.h>
+#include <TMath.h>
#include <TSystem.h>
#include <TDatime.h>
#include <TH2.h>
//____________________________________________________________________
AliFMDCalibPedestal*
-AliFMDPreprocessor::GetPedestalCalibration(TList* pedFiles)
+AliFMDPreprocessor::GetPedestalCalibration(const TList* pedFiles)
{
// Read DAQ DA produced CSV files of pedestals, and return a
// calibration object.
TObjString* fileSource;
while((fileSource = dynamic_cast<TObjString*>(iter.Next()))) {
- const Char_t* filename = GetFile(kDAQ, pars->GetPedestalShuttleID(), fileSource->GetName());
+ const Char_t* filename = GetFile(kDAQ, pars->GetPedestalShuttleID(),
+ fileSource->GetName());
std::ifstream in(filename);
if(!in) {
Log(Form("File %s not found!", filename));
//____________________________________________________________________
AliFMDCalibGain*
-AliFMDPreprocessor::GetGainCalibration(TList* gainFiles)
+AliFMDPreprocessor::GetGainCalibration(const TList* gainFiles)
{
// Read DAQ DA produced CSV files of pedestals, and return a
// calibration object.
TIter iter(gainFiles);
TObjString* fileSource;
while((fileSource = dynamic_cast<TObjString *>(iter.Next()))) {
- const Char_t* filename = GetFile(kDAQ, pars->GetGainShuttleID(), fileSource->GetName());
+ const Char_t* filename = GetFile(kDAQ, pars->GetGainShuttleID(),
+ fileSource->GetName());
std::ifstream in(filename);
if(!in) {
Log(Form("File %s not found!", filename));
/** Get an entry from OCDB */
AliCDBEntry* GetFromCDB(const char* second, const char* third);
protected:
- /** Get the pedestal calibrations
- @param list List of files */
- AliFMDCalibPedestal* GetPedestalCalibration(TList* list);
- /** Get the gain calibrations
- @param list List of files */
- AliFMDCalibGain* GetGainCalibration(TList*);
- /** Get the dead channels map based on the pedestal
- an gain calibration objects. */
-
+ /**
+ * Get the pedestal calibrations
+ *
+ * @param list List of files
+ */
+ AliFMDCalibPedestal* GetPedestalCalibration(const TList* list);
+ /**
+ * Get the gain calibrations
+ *
+ * @param list List of files
+ */
+ AliFMDCalibGain* GetGainCalibration(const TList*);
+ /**
+ * Get the dead channels map based on the pedestal
+ * an gain calibration objects.
+ */
AliFMDCalibDeadMap* GetDeadChannelMap(AliFMDCalibPedestal* pedcalib,
AliFMDCalibGain* gaincalib);
AliFMDQADataMakerRec&
AliFMDQADataMakerRec::operator = (const AliFMDQADataMakerRec& qadm )
{
+ //
+ // Assignment operator
+ //
+ // Parameters:
+ // qadm What to assign from
+ //
+ // Return:
+ // Reference to this
+ //
fRecPointsArray = qadm.fRecPointsArray;
return *this;
//_____________________________________________________________________
AliFMDQADataMakerRec::~AliFMDQADataMakerRec()
{
-
+ //
+ // Destrcutor
+ //
}
//_____________________________________________________________________
void AliFMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
{
+ //
+ // Analyse ESD event
+ //
+ // Parameters:
+ // esd ESD event
+ //
if(!esd) {
AliError("FMD ESD object not found!!") ;
return;
//_____________________________________________________________________
void AliFMDQADataMakerRec::MakeDigits(TTree * digitTree)
{
+ //
+ // Analyse digits
+ //
+ // Parameters:
+ // digitTree Tree of digits
+ //
if (fDigitsArray)
fDigitsArray->Clear();
//_____________________________________________________________________
void AliFMDQADataMakerRec::MakeRaws(AliRawReader* rawReader)
{
+ //
+ // Analyse raw
+ //
+ // Parameters:
+ // rawReader Raw reader
+ //
- AliFMDRawReader fmdReader(rawReader,0);
+ AliFMDRawReader fmdReader(rawReader,0);
if (fDigitsArray)
fDigitsArray->Clear();
Int_t AliFMDQADataMakerRec::GetHalfringIndex(UShort_t det,
Char_t ring,
UShort_t board,
- UShort_t monitor) {
-
+ UShort_t monitor) const
+{
+ //
+ // Get the half-ring index
+ //
+ // Parameters:
+ // det Detector
+ // ring Ring
+ // board Board number
+ // monitor Monitor
+ //
+ // Return:
+ // Half ring index
+ //
UShort_t iring = (ring == 'I' ? 1 : 0);
-
- Int_t index = ( ((det-1) << 3) | (iring << 2) | (board << 1) | (monitor << 0));
+ Int_t index = ( ((det-1) << 3) | (iring << 2) | (board << 1) |
+ (monitor << 0));
return index-2;
-
}
//_____________________________________________________________________
class AliFMDQADataMakerRec: public AliQADataMakerRec
{
public:
+ /**
+ * Constructor
+ */
AliFMDQADataMakerRec();
+ /**
+ * Copy constructor
+ *
+ * @param qadm What to copy from
+ */
AliFMDQADataMakerRec(const AliFMDQADataMakerRec& qadm);
+ /**
+ * Assignment operator
+ *
+ * @param qadm What to assign from
+ *
+ * @return Reference to this
+ */
AliFMDQADataMakerRec& operator = (const AliFMDQADataMakerRec& qadm) ;
+ /**
+ * Destrcutor
+ */
virtual ~AliFMDQADataMakerRec();
private:
+ /**
+ * Called at end of monitor cycle
+ *
+ * @param TASKINDEX_t Task
+ * @param list Output list
+ */
virtual void EndOfDetectorCycle(AliQAv1::TASKINDEX_t, TObjArray ** list);
+ /**
+ * Intialize for ESD
+ */
virtual void InitESDs();
+ /**
+ * Intialize for Digits
+ */
virtual void InitDigits();
+ /**
+ * Intialize for RecPoints
+ */
virtual void InitRecPoints();
+ /**
+ * Initialise for raw
+ */
virtual void InitRaws();
+ /**
+ * Analyse ESD event
+ *
+ * @param esd ESD event
+ */
virtual void MakeESDs(AliESDEvent * esd);
+ /**
+ * Analyse digits
+ */
virtual void MakeDigits();
+ /**
+ * Analyse digits
+ *
+ * @param digitTree Tree of digits
+ */
virtual void MakeDigits(TTree * digitTree);
+ /**
+ * Analyse rec points
+ *
+ * @param recpoTree Tree of RecPoints
+ */
virtual void MakeRecPoints(TTree * recpoTree);
+ /**
+ * Analyse raw
+ *
+ * @param rawReader Raw reader
+ */
virtual void MakeRaws(AliRawReader* rawReader);
+ /**
+ * Called at start of a cycle
+ *
+ */
virtual void StartOfDetectorCycle();
- Int_t GetHalfringIndex(UShort_t det, Char_t ring, UShort_t board, UShort_t monitor = 0);
+ /**
+ * Get the half-ring index
+ *
+ * @param det Detector
+ * @param ring Ring
+ * @param board Board number
+ * @param monitor Monitor
+ *
+ * @return Half ring index
+ */
+ Int_t GetHalfringIndex(UShort_t det, Char_t ring,
+ UShort_t board, UShort_t monitor = 0) const;
ClassDef(AliFMDQADataMakerRec,0) // description
- TClonesArray fRecPointsArray;
-
+ TClonesArray fRecPointsArray; // Rec points
};
#endif // AliFMDQADataMakerRec_H
*/
#include "AliQADataMakerSim.h"
-#include "TClonesArray.h"
+// #include "TClonesArray.h"
class TH1F ;
class TH1I ;
class TList ;
UInt_t ddl = input.GetDDLNumber();
AliFMDDebug(2, ("DDL number %d", ddl));
- /* Note, previously, the ALTROCFG1 register was interpreted as
- *
- * Bits Value Description
- * 0- 3 0/1 1st Baseline filter, mode
- * 4- 5 Over-1 2nd baseline filter, # of pre-samples
- * 6- 9 factor 2nd baseline filter, # of post-samples
- * 10- 0 2nd baseline filter, enable
- * 11-12 00 Zero suppression, glitch filter mode
- * 13-15 001 Zero suppression, # of post samples
- * 16-17 01 Zero suppression, # of pre samples
- * 18 0/1 Zero suppression, enable
- *
- * The interpretation used in AliAltroRawStreamerV3 - which
- * corresponds directly to ALTRO DPCFG register - is
- *
- * Bits Value Description
- * 0- 3 0/1 1st Baseline filter, mode
- * 4 0 Polarity (if '1', then "1's inverse")
- * 5- 6 01 Zero suppression, # of pre samples
- * 7-10 0001 Zero suppression, # of post samples
- * 11 0 2nd baseline filter, enable
- * 12-13 00 Zero suppression, glitch filter mode
- * 14-16 factor 2nd baseline filter, # of post-samples
- * 17-18 01 2nd baseline filter, # of pre-samples
- * 19 0/1 Zero suppression, enable
- *
- * Writing 'x' for variable values, that means we have the
- * following patterns for the 2 cases
- *
- * bit # 20 16 12 8 4 0
- * old |0x01|0010|00xx|xxxx|xxxx|
- * new |x01x|xx00|0000|1010|xxxx|
- *
- * That means that we can check if bits 10-13 are '1000' or
- * '0000', which will tell us if the value was written with the
- * new or the old interpretation. That is, we can check that
- *
- * if (((altrocfg1 >> 10) & 0x8) == 0x8) {
- * // old interpretation
- * }
- * else {
- * // New interpretation
- * }
- *
- * That means, that we should never
- *
- * - change the # of zero suppression post samples
- * - Turn on 2nd baseline correction
- * - Change the zero-suppression glitch filter mode
- *
- * This change as introduced in version 1.2 of Rcu++
- */
+ // Note, previously, the ALTROCFG1 register was interpreted as
+ //
+ // Bits Value Description
+ // 0- 3 0/1 1st Baseline filter, mode
+ // 4- 5 Over-1 2nd baseline filter, # of pre-samples
+ // 6- 9 factor 2nd baseline filter, # of post-samples
+ // 10- 0 2nd baseline filter, enable
+ // 11-12 00 Zero suppression, glitch filter mode
+ // 13-15 001 Zero suppression, # of post samples
+ // 16-17 01 Zero suppression, # of pre samples
+ // 18 0/1 Zero suppression, enable
+ //
+ // The interpretation used in AliAltroRawStreamerV3 - which
+ // corresponds directly to ALTRO DPCFG register - is
+ //
+ // Bits Value Description
+ // 0- 3 0/1 1st Baseline filter, mode
+ // 4 0 Polarity (if '1', then "1's inverse")
+ // 5- 6 01 Zero suppression, # of pre samples
+ // 7-10 0001 Zero suppression, # of post samples
+ // 11 0 2nd baseline filter, enable
+ // 12-13 00 Zero suppression, glitch filter mode
+ // 14-16 factor 2nd baseline filter, # of post-samples
+ // 17-18 01 2nd baseline filter, # of pre-samples
+ // 19 0/1 Zero suppression, enable
+ //
+ // Writing 'x' for variable values, that means we have the
+ // following patterns for the 2 cases
+ //
+ // bit # 20 16 12 8 4 0
+ // old |0x01|0010|00xx|xxxx|xxxx|
+ // new |x01x|xx00|0000|1010|xxxx|
+ //
+ // That means that we can check if bits 10-13 are '1000' or
+ // '0000', which will tell us if the value was written with the
+ // new or the old interpretation. That is, we can check that
+ //
+ // if (((altrocfg1 >> 10) & 0x8) == 0x8) {
+ // // old interpretation
+ // }
+ // else {
+ // // New interpretation
+ // }
+ //
+ // That means, that we should never
+ //
+ // - change the # of zero suppression post samples
+ // - Turn on 2nd baseline correction
+ // - Change the zero-suppression glitch filter mode
+ //
+ // This change as introduced in version 1.2 of Rcu++
+ //
UInt_t cfg1 = input.GetAltroCFG1();
if (((cfg1 >> 10) & 0x8) == 0x8) {
UInt_t cfg2 = input.GetAltroCFG2();
//____________________________________________________________________
Int_t
-AliFMDRawReader::NewChannel(AliAltroRawStreamV3& input, UShort_t det,
+AliFMDRawReader::NewChannel(const AliAltroRawStreamV3& input, UShort_t det,
Char_t& ring, UShort_t& sec, Short_t& strbase)
{
// Processs a new channel. Sets the internal data members
//____________________________________________________________________
Int_t
-AliFMDRawReader::NewSample(AliAltroRawStreamV3& input,
+AliFMDRawReader::NewSample(const AliAltroRawStreamV3& input,
Int_t i, UShort_t t, UShort_t sec,
UShort_t strbase, Short_t& str, UShort_t& samp)
{
Short_t& adc, Bool_t& zs,
UShort_t& fac)
{
+ //
+ // Get the next signal
+ //
+ // Parameters:
+ // det On return, the detector
+ // rng On return, the ring
+ // sec On return, the sector
+ // str On return, the strip
+ // adc On return, the ADC value
+ // zs On return, whether zero-supp. is enabled
+ // fac On return, the usd noise factor
+ //
+ // Return:
+ // true if valid data is returned
+ //
do {
UShort_t samp, rate;
TArrayS &pulseLength,
Bool_t* detectors)
{
-
+ //
+ // Read SOD event into passed objects.
+ //
+ // Parameters:
+ // samplerate The sample rate object to fill
+ // striprange The strip range object to fill
+ // pulseSize The pulse size object to fill
+ // pulseLength The pulse length (in events) object to fill
+ //
+ // Return:
+ // @c true on success
+ //
AliFMDDebug(0, ("Start of SOD/EOD"));
UInt_t shift_clk[18];
}
//_____________________________________________________________________
Int_t AliFMDRawReader::GetHalfringIndex(UShort_t det, Char_t ring,
- UShort_t board) {
-
+ UShort_t board) const
+{
+ //
+ // Get short index for a given half-ring
+ //
+ // Parameters:
+ // det Detector number
+ // ring Ring identifer
+ // board Board number
+ //
+ // Return:
+ //
+ //
UShort_t iring = (ring == 'I' ? 1 : 0);
Int_t index = (((det-1) << 2) | (iring << 1) | (board << 0));
*
* @return negative value in case of problems, hardware address otherwise
*/
- Int_t NewChannel(AliAltroRawStreamV3& input, UShort_t det, Char_t& ring,
+ Int_t NewChannel(const AliAltroRawStreamV3& input,
+ UShort_t det, Char_t& ring,
UShort_t& sec, Short_t& strbase);
/**
*
* @return negative value in case of problems, ADC value otherwise
*/
- Int_t NewSample(AliAltroRawStreamV3& input, Int_t i, UShort_t t, UShort_t sec,
+ Int_t NewSample(const AliAltroRawStreamV3& input,
+ Int_t i, UShort_t t, UShort_t sec,
UShort_t strbase, Short_t& str, UShort_t& samp);
/**
*
* @return
*/
- Int_t GetHalfringIndex(UShort_t det, Char_t ring, UShort_t board);
+ Int_t GetHalfringIndex(UShort_t det, Char_t ring, UShort_t board) const;
TTree* fTree; //! Pointer to tree to read into
AliRawReader* fReader; //! Pointer to raw reader
UShort_t fSampleRate[3]; // The sample rate (if 0,inferred from data)
UShort_t fMinStrip; // Current minimum strip number (0)
UShort_t fMaxStrip; // Current maximum strip number (127)
UShort_t fPreSamp; // Current number of pre-samples (14+5)
- AliFMDUShortMap fSeen;
+ AliFMDUShortMap fSeen; // Seen strips
ClassDef(AliFMDRawReader, 0) // Read FMD raw data into a cache
};
void
AliFMDRawWriter::WriteDigits(TClonesArray* digits)
{
+ //
+ // Write digits to file
+ //
Int_t nDigits = digits->GetEntries();
if (nDigits < 1) return;
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
-
///////////////////////////////////////////////////////////////////////////////
//
// FMD Reconstruction Parameters
AliFMDRecoParam*
AliFMDRecoParam::GetLowFluxParam()
{
+ //
+ // Get low flux parameter
+ //
+ // Return:
+ // low flux parameters
+ //
AliFMDRecoParam* p = new AliFMDRecoParam(10, kTRUE, kFALSE);
p->SetName("FMD_low_flux");
p->SetTitle("FMD low flux");
AliFMDRecoParam*
AliFMDRecoParam::GetHighFluxParam()
{
+ //
+ // Get high flux parameter
+ //
+ // Return:
+ // high flux parameters
+ //
AliFMDRecoParam* p = new AliFMDRecoParam(10, kTRUE, kFALSE);
p->SetName("FMD_high_flux");
p->SetTitle("FMD high flux");
AliFMDRecoParam*
AliFMDRecoParam::GetParam(AliRecoParam::EventSpecie_t specie)
{
+ //
+ // Get parameters for a specific species
+ //
+ // Parameters:
+ // specie Species
+ //
+ // Return:
+ // Reconstruction paramters
+ //
switch (specie) {
case AliRecoParam::kDefault:
case AliRecoParam::kCalib:
*/
Bool_t SharingCorrect() const { return fSharingCorrect; }
+ /**
+ * Whether to do angle corrections
+ *
+ * @param doit Whether to do angle corrections
+ */
void SetAngleCorrect(Bool_t doit) { fAngleCorrect = doit; }
+ /**
+ * Whether to do sharing corrections
+ *
+ * @param doit Whether to do sharing corrections
+ */
void SetSharingCorrect(Bool_t doit) { fSharingCorrect = doit; }
+ /**
+ * Set the noise factor
+ *
+ * @param f Noise factor
+ */
void SetNoiseFactor(Float_t f) { fNoiseFactor = f; }
+ /**
+ * Get low flux parameter
+ *
+ * @return low flux parameters
+ */
static AliFMDRecoParam* GetLowFluxParam();
+ /**
+ * Get high flux parameter
+ *
+ * @return high flux parameters
+ */
static AliFMDRecoParam* GetHighFluxParam();
+ /**
+ * Get parameters for a specific species
+ *
+ * @param specie Species
+ *
+ * @return Reconstruction paramters
+ */
static AliFMDRecoParam* GetParam(AliRecoParam::EventSpecie_t specie);
private:
Float_t fNoiseFactor; // Noise suppression factor
+//____________________________________________________________________
+//
+// 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
+// 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>
+//
+//
+//____________________________________________________________________
/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* provided "as is" without express or implied warranty. *
**************************************************************************/
/* $Id$ */
-/** @file AliFMDReconstructor.cxx
- @author Christian Holm Christensen <cholm@nbi.dk>
- @date Mon Mar 27 12:47:09 2006
- @brief FMD reconstruction
+/**
+ * @file AliFMDReconstructor.cxx
+ * @author Christian Holm Christensen <cholm@nbi.dk>
+ * @date Mon Mar 27 12:47:09 2006
+ * @brief FMD reconstruction
*/
-//____________________________________________________________________
-//
-// 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
-// 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
void
AliFMDReconstructor::UseRecoParam(Bool_t set) const
{
+ //
+ // Set-up reconstructor to use values from reconstruction
+ // parameters, if present, for this event. If the argument @a set
+ // is @c false, then restore preset values.
+ //
+ // Parameters:
+ // set
+ //
static Float_t savedNoiseFactor = fNoiseFactor;
static Bool_t savedAngleCorrect = fAngleCorrect;
if (set) {
void
AliFMDReconstructor::ProcessDigit(AliFMDDigit* digit) const
{
+ //
+ // Process a single digit
+ //
+ // Parameters:
+ // digit Digiti to process
+ //
UShort_t det = digit->Detector();
Char_t rng = digit->Ring();
UShort_t sec = digit->Sector();
Bool_t zsEnabled,
UShort_t zsNoiseFactor) const
{
+ //
+ // Subtract the pedestal off the ADC counts.
+ //
+ // Parameters:
+ // det Detector number
+ // rng Ring identifier
+ // sec Sector number
+ // str Strip number
+ // adc ADC counts
+ // noiseFactor If pedestal substracted pedestal is less then
+ // this times the noise, then consider this to be 0.
+ // zsEnabled Whether zero-suppression is on.
+ // zsNoiseFactor Noise factor used in on-line pedestal
+ // subtraction.
+ //
+ // Return:
+ // The pedestal subtracted ADC counts (possibly 0), or @c
+ // USHRT_MAX in case of problems.
+ //
AliFMDParameters* param = AliFMDParameters::Instance();
Float_t ped = (zsEnabled ? 0 :
param->GetPedestal(det, rng, sec, str));
AliFMDReconstructor::FillESD(AliRawReader*, TTree* clusterTree,
AliESDEvent* esd) const
{
+ //
+ // Forwards to above member function
+ //
TTree* dummy = 0;
FillESD(dummy, clusterTree, esd);
}
Short_t count4,
UShort_t npart,
UShort_t nprim,
- Int_t* refs)
+ const Int_t* refs)
: AliFMDBaseDigit(detector, ring, sector, strip),
fEdep(edep),
fCount1(count1),
Short_t count4=-1,
UShort_t npart=0,
UShort_t nprim=0,
- Int_t* refs=0);
+ const Int_t* refs=0);
/**
* DTOR
*/
#define NESTED(X) AliFMDSpectraDisplay::AliFMDSpectraDisplay # X
//==================================================================
-void AliFMDSpectraDisplay::AliFMDSpectraDisplayElement::MakeHistograms(TAxis* axis)
+void
+AliFMDSpectraDisplay::AliFMDSpectraDisplayElement::MakeHistograms(const
+ TAxis*
+ axis)
{
// Create the
// needed histograms
*
* @param axis Axis specs
*/
- virtual void MakeHistograms(TAxis* axis);
+ virtual void MakeHistograms(const TAxis* axis);
/**
* Compare to object
*
+//
+// Class to take survey data and
+// transform that to alignment objects.
+//
+// FMD
+//
#include "AliFMDSurveyToAlignObjs.h"
#include "AliLog.h"
#include "AliSurveyPoint.h"
Double_t* trans,
Double_t* rot) const
{
+ //
+ // Calculate the plane translation and rotation from 3 survey points
+ //
+ // Parameters:
+ // a 1st Survey point
+ // b 2nd Survey point
+ // c 3rd Survey point
+ // trans Translation vector
+ // rot Rotation matrix (direction cosines)
+ //
+ // Return:
+ //
+ //
+
// Vector a->b, b->c, and normal to plane defined by these two
// vectors.
TVector3 ab(b-a), bc(c-b);
Double_t* trans,
Double_t* rot) const
{
+ //
+ // Calculate the plane rotation and translation by doing a fit of
+ // the plane equation to the surveyed points. At least 4 points
+ // must be passed in the @a points array with corresponding errors
+ // in the array @a errors. The arrays are assumed to contain
+ // TVector3 objects.
+ //
+ // Parameters:
+ // points Array surveyed positions
+ // errors Array of errors corresponding to @a points
+ // depth Survey targets depth (perpendicular to the plane)
+ // trans On return, translation of the plane
+ // rot On return, rotation (direction cosines) of the plane
+ //
+ // Return:
+ // @c true on success, @c false otherwise
+ //
+
Int_t nPoints = points.GetEntries();
if (nPoints < 4) {
AliError(Form("Cannot fit a plane equation to less than 4 survey points, "
//____________________________________________________________________
Bool_t
AliFMDSurveyToAlignObjs::MakeDelta(const char* path,
- Double_t* rot,
- Double_t* trans,
+ const Double_t* rot,
+ const Double_t* trans,
TGeoHMatrix& delta) const
{
- // Make delta transformation
+ //
+ // Create a delta transform from a global rotation matrix and
+ // translation.
+ //
+ // Parameters:
+ // path Path of element to transform.
+ // rot Rotation matrix (direction cosines)
+ // trans Translation
+ // delta On return, the delta transform
+ //
+ // Return:
+ // Newly
+ //
if (!gGeoManager) return kFALSE;
if (!gGeoManager->cd(path)) return kFALSE;
//____________________________________________________________________
Bool_t
-AliFMDSurveyToAlignObjs::MakeDelta(TGeoMatrix* global,
- Double_t* rot,
- Double_t* trans,
+AliFMDSurveyToAlignObjs::MakeDelta(const TGeoMatrix* global,
+ const Double_t* rot,
+ const Double_t* trans,
TGeoHMatrix& delta) const
{
- // Make delta transformation
+ //
+ // Create a delta transform from a global rotation matrix and
+ // translation.
+ //
+ // Parameters:
+ // global Global matrix of element to transform.
+ // rot Rotation matrix (direction cosines)
+ // trans Translation
+ // delta On return, the delta transform
+ //
+ // Return:
+ // Newly
+ //
TGeoHMatrix* geoM = new TGeoHMatrix;
geoM->SetTranslation(trans);
geoM->SetRotation(rot);
Bool_t
AliFMDSurveyToAlignObjs::GetFMD1Plane(Double_t* rot, Double_t* trans) const
{
+ //
+ // Get the FMD1 plane from the survey points
+ //
+ // Parameters:
+ // rot Rotation matrix (direction cosines)
+ // trans Translation
+ //
+ // Return:
+ // @c true on success, @c false otherwise.
+ //
// The possile survey points
TVector3 icb, ict, ocb, oct, dummy;
Bool_t
AliFMDSurveyToAlignObjs::DoFMD1()
{
+ //
+ // Do the FMD1 analysis. We have 4 survey targets on V0-A on the
+ // C-side. These are
+ //
+ // - V0A_ICT In-side, C-side, top.
+ // - V0A_ICB In-side, C-side, bottom.
+ // - V0A_OCT Out-side, C-side, top.
+ // - V0A_OCB Out-side, C-side, bottom.
+ //
+ // These 4 survey targets sit 3.3mm over the V0-A C-side surface, or
+ // 3.3mm over the back surface of FMD1.
+ //
+ // Since these are really sitting on a plane, we can use the method
+ // proposed by the CORE offline.
+ //
+ // Return:
+ // @c true on success, @c false otherwise.
+ //
+
// Do the FMD1 stuff
Double_t rot[9], trans[3];
if (!GetFMD1Plane(rot, trans)) return kFALSE;
Bool_t
AliFMDSurveyToAlignObjs::GetFMD2Plane(Double_t* rot, Double_t* trans) const
{
+ //
+ // Get the surveyed plane corresponding to the backside of FMD2.
+ // The plane is done as a best fit of the plane equation to at least
+ // 4 of the available survey points.
+ //
+ // Parameters:
+ // rot Rotation matrix (direction cosines)
+ // trans Translation vector.
+ //
+ // Return:
+ // @c true on success, @c false otherwise
+ //
// The possible survey points
const char* names[] = { "FMD2_ITOP", "FMD2_OTOP",
Bool_t
AliFMDSurveyToAlignObjs::DoFMD2()
{
+ //
+ // Do the FMD2 calculations. We have 6 survey points of which only
+ // 5 are normally surveyed. These are all sittings
+ //
+ // - FMD2_ITOP - In-side, top
+ // - FMD2_IBOTM - In-side, middle bottom
+ // - FMD2_IBOT - In-side, bottom
+ // - FMD2_OTOP - Out-side, top
+ // - FMD2_OBOTM - Out-side, middle bottom
+ // - FMD2_OBOT - Out-side, bottom
+ //
+ // The nominal coordinates of these retro-fitted survey stickers
+ // isn't known. Also, these stickers are put on a thin (0.3mm
+ // thick) carbon cover which flexes quite easily. This means, that
+ // to rotations and xy-translation obtained from the survey data
+ // cannot be used, and left is only the z-translation.
+ //
+ // Further more, since FMD2 to is attached to the ITS SPD thermal
+ // screen, it is questionable if the FMD2 survey will ever be used.
+ //
+ // Return:
+ // @c true on success, @c false otherwise.
+ //
+
// Do the FMD2 stuff
Double_t rot[9], trans[3];
if (!GetFMD2Plane(rot, trans)) return kFALSE;
void
AliFMDSurveyToAlignObjs::Run()
{
+ //
+ // Run the task.
+ //
+ //
+
AliFMDGeometry* geom = AliFMDGeometry::Instance();
geom->Init();
geom->InitTransformations();
Bool_t
AliFMDSurveyToAlignObjs::CreateAlignObjs()
{
+ //
+ //
+ // Method to create the alignment objects
+ //
+ // Return:
+ // @c true on success, @c false otherwise
+ //
TClonesArray& array = *fAlignObjArray;
Int_t n = array.GetEntriesFast();
void
AliFMDSurveyToAlignObjs::PrintVector(const char* text, const TVector3& v)
{
- // Print a vector
+ //
+ // Service member function to print a vector
+ //
+ // Parameters:
+ // text Prefix text
+ // v Vector
+ //
Double_t va[] = { v.X(), v.Y(), v.Z() };
PrintVector(text, va);
}
void
AliFMDSurveyToAlignObjs::PrintVector(const char* text, const Double_t* v)
{
- // Print a vector
+ //
+ // Service member function to print a vector
+ //
+ // Parameters:
+ // text Prefix text
+ // v Vector (array of 3 doubles)
+ //
std::cout << text
<< std::setw(15) << v[0]
<< std::setw(15) << v[1]
void
AliFMDSurveyToAlignObjs::PrintRotation(const char* text, const Double_t* rot)
{
- // Print a rotation matrix
+ //
+ // Service member function to print a rotation matrix
+ //
+ // Parameters:
+ // text Prefix text
+ // v Matrix (array of 9 doubles)
+ //
+
std::cout << text << std::endl;
for (size_t i = 0; i < 3; i++) {
for (size_t j = 0; j < 3; j++)
*
* @return Newly
*/
- Bool_t MakeDelta(TGeoMatrix* global,
- Double_t* rot,
- Double_t* trans,
+ Bool_t MakeDelta(const TGeoMatrix* global,
+ const Double_t* rot,
+ const Double_t* trans,
TGeoHMatrix& delta) const;
/**
* Create a delta transform from a global rotation matrix and
* @return Newly
*/
Bool_t MakeDelta(const char* path,
- Double_t* rot,
- Double_t* trans,
+ const Double_t* rot,
+ const Double_t* trans,
TGeoHMatrix& delta) const;
/**
* Service member function to print a vector
AliFMDSurveyToAlignObjs.cxx)
string (REPLACE ".cxx" ".h" HDRS "${SRCS}")
-
+set ( HDRS ${HDRS} AliFMDCalibFwd.h )
set ( DHDR FMDbaseLinkDef.h)
set ( EINCLUDE RAW)
+++ /dev/null
-#--------------------------------------------------------------------------------#
-# Package File for FMDflow #
-# Author : Johny Jose (johny.jose@cern.ch) #
-# Variables Defined : #
-# #
-# SRCS - C++ source files #
-# HDRS - C++ header files #
-# DHDR - ROOT Dictionary Linkdef header file #
-# CSRCS - C source files #
-# CHDRS - C header files #
-# EINCLUDE - Include directories #
-# EDEFINE - Compiler definitions #
-# ELIBS - Extra libraries to link #
-# ELIBSDIR - Extra library directories #
-# PACKFFLAGS - Fortran compiler flags for package #
-# PACKCXXFLAGS - C++ compiler flags for package #
-# PACKCFLAGS - C compiler flags for package #
-# PACKSOFLAGS - Shared library linking flags #
-# PACKLDFLAGS - Module linker flags #
-# PACKBLIBS - Libraries to link (Executables only) #
-# EXPORT - Header files to be exported #
-# CINTHDRS - Dictionary header files #
-# CINTAUTOLINK - Set automatic dictionary generation #
-# ARLIBS - Archive Libraries and objects for linking (Executables only) #
-# SHLIBS - Shared Libraries and objects for linking (Executables only) #
-#--------------------------------------------------------------------------------#
-
-set ( SRCS flow/AliFMDFlowAxis.cxx flow/AliFMDFlowBessel.cxx flow/AliFMDFlowBin.cxx flow/AliFMDFlowBinned1D.cxx flow/AliFMDFlowBinned2D.cxx flow/AliFMDFlowEfficiency.cxx flow/AliFMDFlowEventPlane.cxx flow/AliFMDFlowHarmonic.cxx flow/AliFMDFlowResolution.cxx flow/AliFMDFlowTrue.cxx flow/AliFMDFlowSplitter.cxx)
-
-string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
-
-set ( HDRS ${HDRS} flow/AliFMDFlowStat.h flow/AliFMDFlowUtil.h)
-
-set ( DHDR flow/FMDflowLinkDef.h)
-
-set ( EINCLUDE FMD/flow)
-#--------------------------------------------------------------------------------#
-# Package File for FMDrec #
-# Author : Johny Jose (johny.jose@cern.ch) #
-# Variables Defined : #
-# #
-# SRCS - C++ source files #
-# HDRS - C++ header files #
-# DHDR - ROOT Dictionary Linkdef header file #
-# CSRCS - C source files #
-# CHDRS - C header files #
-# EINCLUDE - Include directories #
-# EDEFINE - Compiler definitions #
-# ELIBS - Extra libraries to link #
-# ELIBSDIR - Extra library directories #
-# PACKFFLAGS - Fortran compiler flags for package #
-# PACKCXXFLAGS - C++ compiler flags for package #
-# PACKCFLAGS - C compiler flags for package #