Re-enabled RAW I/O using AliAltroBuffer and AliAltroRawStream.
Re-implemented AliFMDRawStream for better use with AliAltroRawStream.
Added strip range to calibration parameters. Perhaps I also need
a calibration that says how many pre-samples the ALTRO makes. Currrently
with the hardware we have now, it seems that the ALTRO makes 4 pre-samples,
regardless of the oversampling rate. However, we've only varied the
VA1 shift clock (between 5 and 1.25MHz), relative to 10MHZ for the ALTRO
sample clock. It may be that the number of pre-samples is a constant time,
which means it depends on the actual sample clock frequency. If that's the
case, then this parameter should be stored with the sampling rate parameter.
If not, then it should probably be stored independently.
I'm seriously considering making a base class, AliFMDIndex, like
struct AliFMDIndex {
UShort_t fDetector;
Char_t fRing;
UShort_t fSector;
UShort_t fStrip;
};
and have the `per-strip' classes derive from that, like
class AliFMDHit : public AliHit, public AliFMDIndex { ... }
class AliFMDDigit : public TObject, public AliFMDIndex { ... }
What does the experts think about that?
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMD.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 17:59:18 2006
+ @brief Implementation of AliFMD base class
+*/
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers. This class
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMD.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 17:59:37 2006
+ @brief Declaration of AliFMD detector driver
+*/
/** @mainpage ALICE FMD Off-line code
@b Contents
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMD1.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:00:23 2006
+ @brief Implementation of FMD1 parameters
+*/
//____________________________________________________________________
//
// Concrete implementation of AliFMDDetector
#ifndef ALIFMD1_H
#define ALIFMD1_H
-//
-// $Id$
-//
+/* $Id$ */
+/** @file AliFMD1.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:00:56 2006
+ @brief Declaration of FMD1 declaration
+*/
+
#ifndef ALIFMDDETECTOR_H
# include "AliFMDDetector.h"
#endif
//__________________________________________________________________
/** @class AliFMD1 AliFMD1.h <FMD/AliFMD1.h>
- Geometry description and parameters of the FMD1 detector.
+ @brief Geometry description and parameters of the FMD1 detector.
The FMD1 has only one ring.
+ @image html FMD1.png
@ingroup FMD_base
*/
class AliFMD1 : public AliFMDDetector
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMD2.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:25:51 2006
+ @brief Concrete implementation of AliFMDDetector for FMD2
+*/
//____________________________________________________________________
//
// Concrete implementation of AliFMDDetector
//
#ifndef ALIFMD2_H
#define ALIFMD2_H
-
+/** @file AliFMD2.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:25:28 2006
+ @brief Geometry parameters of the FMD2 detector.
+*/
#ifndef ALIFMDDETECTOR_H
# include "AliFMDDetector.h"
#endif
//____________________________________________________________________
/** @class AliFMD2 AliFMD2.h <FMD/AliFMD2.h>
- Geometry parameters of the FMD2 detector. This has two rings.
+ @brief Geometry parameters of the FMD2 detector.
+ This has two rings.
+ @image html FMD2.png
@ingroup FMD_base
*/
class AliFMD2 : public AliFMDDetector
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMD3.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:26:12 2006
+ @brief Concrete implementation of AliFMDDetector for FMD3
+*/
//____________________________________________________________________
//
// Concrete implementation of AliFMDDetector
//
#ifndef ALIFMD3_H
#define ALIFMD3_H
-
+/** @file AliFMD3.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:23:48 2006
+ @brief Geometry parameters of the FMD3 detector.
+*/
#ifndef ALIFMDDETECTOR_H
# include "AliFMDDetector.h"
#endif
/** @class AliFMD3 AliFMD3.h <FMD/AliFMD3.h>
- Geometry parameters of the FMD3 detector. FMD3 has a fairly
- complicated support structure. The cone also supports the
- beam-pipe.
+ @brief Geometry parameters of the FMD3 detector.
+ FMD3 has a fairly complicated support structure. The cone also
+ supports the beam-pipe.
+ @image html FMD3.png
@ingroup FMD_base
*/
class AliFMD3 : public AliFMDDetector
* about the suitability of this software for any purpose. It is *
* 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
+*/
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers.
}
TString t(GetTitle());
- if (t.Contains("local://") || t.Contains("alien://"))
+ if (t.IsNull() || t.Contains("local://") || t.Contains("alien://"))
WriteToCDB();
else
WriteToFile();
{
// Make the objects.
AliCDBManager* cdb = AliCDBManager::Instance();
- if (GetTitle()) cdb->SetDefaultStorage(GetTitle());
+ if (GetTitle() && GetTitle()[0] != '\0')
+ cdb->SetDefaultStorage(GetTitle());
AliCDBMetaData* meta = new AliCDBMetaData;
meta->SetResponsible(gSystem->GetUserInfo()->fRealName.Data());
*
* 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
+*/
//____________________________________________________________________
//
// Class to make fake alignration parameters
class TString;
/** @class AliFMDAlignFaker
- This task creates fake alignment. Which alignment, depends on the
- bit mask passed to the constructor, or added by `AddAlign'.
+ @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
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDAltroIO.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:27:06 2006
+ @brief Altro Input/Output
+*/
//____________________________________________________________________
//
// Mapping of ALTRO hardware channel to detector coordinates
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDAltroIO.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:27:31 2006
+ @brief ALTRO Input/output
+*/
#include <iosfwd>
#include <TObject.h>
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDAltroMapping.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:27:56 2006
+ @brief Map HW to detector
+*/
//____________________________________________________________________
//
// Mapping of ALTRO hardware channel to detector coordinates
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDAltroMapping.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:28:11 2006
+ @brief Map HW address to detector coordinates and back again.
+*/
#ifndef ALIALTROMAPPING_H
# include <AliAltroMapping.h>
#endif
* is provided "as is" without express or implied warranty. *
**************************************************************/
/* $Id$ */
+/** @file AliFMDBoolMap.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:28:42 2006
+ @brief Per strip Boolean map
+*/
//__________________________________________________________
//
// Map of Bool_t for each FMD strip
* Created Mon Nov 8 12:51:51 2004 by Christian Holm Christensen
*/
/* $Id$ */
+/** @file AliFMDBoolMap.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:28:59 2006
+ @brief Per strip boolean map
+*/
//__________________________________________________________
//
// Map of Bool_t for each FMD strip
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDCalibFaker.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:29:21 2006
+ @brief Make fake calibration data
+*/
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers.
#include "AliFMDCalibPedestal.h" // ALIFMDCALIBPEDESTAL_H
#include "AliFMDCalibSampleRate.h" // ALIFMDCALIBPEDESTAL_H
#include "AliFMDAltroMapping.h" // ALIFMDALTROMAPPING_H
+#include "AliFMDCalibStripRange.h" // ALIFMDCALIBSTRIPRANGE_H
#include <AliCDBManager.h> // ALICDBMANAGER_H
#include <AliCDBEntry.h> // ALICDBMANAGER_H
#include <Riostream.h>
fRate(1),
fZeroThreshold(0),
fRunMin(0),
- fRunMax(10)
+ fRunMax(10),
+ fStripMin(0),
+ fStripMax(127)
{
// Default constructor
}
Float_t maxADC = param->GetAltroChannelSize();
TObjArray cleanup;
- if (GetTitle()) cdb->SetDefaultStorage(GetTitle());
+ if (GetTitle() && GetTitle()[0] != '\0') {
+ AliInfo(Form("Setting default storage to '%s'", GetTitle()));
+ cdb->SetDefaultStorage(GetTitle());
+ }
+
AliCDBMetaData* meta = 0;
if (TESTBIT(fMask, kPulseGain)) {
cleanup.Add(rate);
cleanup.Add(meta);
}
+ if (TESTBIT(fMask, kStripRange)) {
+ fRate = TMath::Max(TMath::Min(fRate, UShort_t(8)), UShort_t(1));
+ AliFMDCalibStripRange* range = MakeStripRange();
+ AliCDBId id(AliFMDParameters::fgkStripRange,fRunMin,fRunMax);
+ MAKE_META(meta);
+ meta->SetProperty("key1", range);
+ cdb->Put(range, id, meta);
+ cleanup.Add(range);
+ cleanup.Add(meta);
+ }
if (TESTBIT(fMask, kAltroMap)) {
AliFMDAltroMapping* altroMap = MakeAltroMap();
AliCDBId id(AliFMDParameters::fgkAltroMap, fRunMin, fRunMax);
AliFMDCalibFaker::MakeSampleRate()
{
AliFMDCalibSampleRate* sampleRate = new AliFMDCalibSampleRate;
- for (int i = 0; i < 3; i++)
- sampleRate->Set(AliFMDParameters::kBaseDDL+i, fRate);
+ for (UShort_t det = 1; det <= 3; det++) {
+ Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
+ for (Char_t* ring = rings; *ring != '\0'; ring++) {
+ UShort_t nSec = ( *ring == 'I' ? 20 : 40 );
+ for (UShort_t sec = 0; sec < nSec; sec++) {
+ sampleRate->Set(det, *ring, sec, 0, fRate);
+ }
+ }
+ }
return sampleRate;
}
+//__________________________________________________________________
+AliFMDCalibStripRange*
+AliFMDCalibFaker::MakeStripRange()
+{
+ AliFMDCalibStripRange* striprange = new AliFMDCalibStripRange;
+ for (UShort_t det = 1; det <= 3; det++) {
+ Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
+ for (Char_t* ring = rings; *ring != '\0'; ring++) {
+ UShort_t nSec = ( *ring == 'I' ? 20 : 40 );
+ for (UShort_t sec = 0; sec < nSec; sec++) {
+ striprange->Set(det, *ring, sec, 0, fStripMin, fStripMax);
+ }
+ }
+ }
+ return striprange;
+}
+
//__________________________________________________________________
AliFMDAltroMapping*
AliFMDCalibFaker::MakeAltroMap()
*
* See cxx source for full Copyright notice
*/
-
+/** @file AliFMDCalibFaker.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:29:36 2006
+ @brief Make fake calibration data
+*/
//____________________________________________________________________
//
// Class to make fake calibration parameters
/** Dead map */
kDeadMap,
/** Hardware map */
- kAltroMap
+ kAltroMap,
+ /** Strip range */
+ kStripRange
};
enum {
/** All parameters */
kAll = (1<<kZeroSuppression|1<<kSampleRate|1<<kPedestal|
- 1<<kPulseGain|1<<kDeadMap|1<<kAltroMap)
+ 1<<kPulseGain|1<<kDeadMap|1<<kAltroMap|1<<kStripRange)
};
/** Constructor
@param mask Bit mask of what to make
/** Set the zero suppression threshold
@param t Threshold (in ADC counts) */
void SetZeroThreshold(UShort_t t) { fZeroThreshold = t; }
+ /** Set strip validty range
+ @param min Minimum strip number
+ @param max Maximum strip number */
+ void SetStripRange(UShort_t min, UShort_t max)
+ {
+ fStripMin = min;
+ fStripMax = (max < min ? min : max);
+ }
/** Set the default output storage. It must be a CDB URL.
@param url CDB URL. */
void SetDefaultStorage(const char* url) { SetTitle(url); }
/** Make a hardware map
@return hardware map */
virtual AliFMDAltroMapping* MakeAltroMap();
+ /** Make a strip range
+ @return strip range map */
+ virtual AliFMDCalibStripRange* MakeStripRange();
Long_t fMask; // What to write
Float_t fGain; // Gain
UShort_t fZeroThreshold; // Zero suppression threshold
Int_t fRunMin;
Int_t fRunMax;
+ UShort_t fStripMin;
+ UShort_t fStripMax;
ClassDef(AliFMDCalibFaker,0)
};
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDCalibGain.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:30:02 2006
+ @brief Per strip gain calibration
+*/
//____________________________________________________________________
//
//
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDCalibGain.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:30:16 2006
+ @brief Per strip gain calibration
+*/
#ifndef ALIFMDFLOATMAP_H
# include <AliFMDFloatMap.h>
#endif
//____________________________________________________________________
-/** Gain value and width for each strip in the FMD
+/** @brief Gain value and width for each strip in the FMD
@ingroup FMD_base
*/
class AliFMDCalibGain : public TObject
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDCalibPedestal.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:30:36 2006
+ @brief Per strip pedestal calibration
+*/
//____________________________________________________________________
//
//
AliFMDCalibPedestal::Width(UShort_t det, Char_t ring, UShort_t sec,
UShort_t str)
{
- return fValue(det, ring, sec, str);
+ return fWidth(det, ring, sec, str);
}
//____________________________________________________________________
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDCalibPedestal.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:30:51 2006
+ @brief Per strip pedestal calibration
+*/
#ifndef ALIFMDFLOATMAP_H
# include <AliFMDFloatMap.h>
#endif
//____________________________________________________________________
-/** Pedestal value and width for each strip in the FMD
+/** @brief Pedestal value and width for each strip in the FMD
@ingroup FMD_base
*/
class AliFMDCalibPedestal : public TObject
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDCalibSampleRate.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:31:09 2006
+ @brief Per digitizer card pulser calibration
+*/
//____________________________________________________________________
//
//
//
#include "AliFMDCalibSampleRate.h" // ALIFMDCALIBGAIN_H
#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
+#include <AliLog.h>
//____________________________________________________________________
ClassImp(AliFMDCalibSampleRate)
//____________________________________________________________________
AliFMDCalibSampleRate::AliFMDCalibSampleRate()
- : fRates(3)
+ : fRates(AliFMDMap::kMaxDetectors, AliFMDMap::kMaxRings, 2, 1)
+ // fRates(3)
{
- fRates.Reset(0);
+ fRates.Reset(1);
}
//____________________________________________________________________
//____________________________________________________________________
void
-AliFMDCalibSampleRate::Set(UShort_t ddl, UShort_t rate)
+AliFMDCalibSampleRate::Set(UShort_t det, Char_t ring,
+ UShort_t sector, UShort_t, UShort_t rate)
{
- if (ddl - AliFMDParameters::kBaseDDL < 0) return;
- fRates[ddl - AliFMDParameters::kBaseDDL] = rate;
+ UInt_t nSec = (ring == 'I' ? 20 : 40);
+ UInt_t board = sector / nSec;
+ fRates(det, ring, board, 0) = rate;
}
//____________________________________________________________________
UShort_t
-AliFMDCalibSampleRate::Rate(UShort_t ddl) const
+AliFMDCalibSampleRate::Rate(UShort_t det, Char_t ring,
+ UShort_t sec, UShort_t) const
{
- if (ddl - AliFMDParameters::kBaseDDL < 0) return 0;
- return fRates[ddl - AliFMDParameters::kBaseDDL];
+ UInt_t nSec = (ring == 'I' ? 20 : 40);
+ UInt_t board = sec / nSec;
+ AliDebug(10, Form("Getting sample rate for FMD%d%c[%2d,0] (board %d)",
+ det, ring, sec, board));
+ return fRates(det, ring, board, 0);
}
//____________________________________________________________________
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDCalibSampleRate.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:32:14 2006
+ @brief Per digitizer card pulser calibration
+
+*/
#ifndef ROOT_TObject
# include <TObject.h>
#endif
+#ifndef ALIFMDUSHORTMAP_H
+# include "AliFMDUShortMap.h"
+#endif
#ifndef ROOT_TArrayI
# include <TArrayI.h>
#endif
//____________________________________________________________________
-/** Gain value and width for each strip in the FMD
+/** @brief Per digitizer card pulser calibration
@ingroup FMD_base
*/
class AliFMDCalibSampleRate : public TObject
@return Reference to assign from */
AliFMDCalibSampleRate& operator=(const AliFMDCalibSampleRate& o);
/** Set sample for a DDL
- @param ddl DDL (detector)
+ @param det Detector #
+ @param ring Ring ID
+ @param sec Sector #
+ @param str Strip number (not used)
@param rate Sample rate */
- void Set(UShort_t ddl, UShort_t rate);
+ void Set(UShort_t det, Char_t ring, UShort_t sec, UShort_t str,
+ UShort_t rate);
/** Get sample rate for a detector
- @param ddl Detector (DDL) identifier
+ @param det Detector #
+ @param ring Ring ID
+ @param sec Sector #
+ @param str Strip number (not used)
@return Sample rate */
- UShort_t Rate(UShort_t ddl) const;
+ UShort_t Rate(UShort_t det, Char_t ring, UShort_t sec, UShort_t str=0) const;
protected:
- TArrayI fRates; // Sample rates
- ClassDef(AliFMDCalibSampleRate,1); // Sample rates
+ // TArrayI fRates; // Sample rates
+ AliFMDUShortMap fRates;
+ ClassDef(AliFMDCalibSampleRate,2); // Sample rates
};
#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+/* $Id$ */
+/** @file AliFMDCalibStripRange.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:31:09 2006
+ @brief Per digitizer card pulser calibration
+*/
+//____________________________________________________________________
+//
+//
+//
+#include "AliFMDCalibStripRange.h" // ALIFMDCALIBGAIN_H
+#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
+
+//____________________________________________________________________
+ClassImp(AliFMDCalibStripRange)
+#if 0
+ ; // This is here to keep Emacs for indenting the next line
+#endif
+
+//____________________________________________________________________
+AliFMDCalibStripRange::AliFMDCalibStripRange()
+ : fRates(AliFMDMap::kMaxDetectors, AliFMDMap::kMaxRings, 2, 1)
+ // fRates(3)
+{
+ fRates.Reset(1);
+}
+
+//____________________________________________________________________
+AliFMDCalibStripRange::AliFMDCalibStripRange(const AliFMDCalibStripRange& o)
+ : TObject(o), fRates(o.fRates)
+{}
+
+//____________________________________________________________________
+AliFMDCalibStripRange&
+AliFMDCalibStripRange::operator=(const AliFMDCalibStripRange& o)
+{
+ fRates = o.fRates;
+ return (*this);
+}
+
+//____________________________________________________________________
+void
+AliFMDCalibStripRange::Set(UShort_t det, Char_t ring,
+ UShort_t sector, UShort_t, UShort_t min,
+ UShort_t max)
+{
+ UInt_t nSec = (ring == 'I' ? 20 : 40);
+ UInt_t board = sector / nSec;
+ fRates(det, ring, board, 0) = ((max & 0x7f) << 8) + (min & 0x7f);
+}
+
+//____________________________________________________________________
+UShort_t
+AliFMDCalibStripRange::Min(UShort_t det, Char_t ring,
+ UShort_t sec, UShort_t) const
+{
+ UInt_t nSec = (ring == 'I' ? 20 : 40);
+ UInt_t board = sec / nSec;
+ return (fRates(det, ring, board, 0) & 0x7f);
+}
+
+//____________________________________________________________________
+UShort_t
+AliFMDCalibStripRange::Max(UShort_t det, Char_t ring,
+ UShort_t sec, UShort_t) const
+{
+ UInt_t nSec = (ring == 'I' ? 20 : 40);
+ UInt_t board = sec / nSec;
+ return ((fRates(det, ring, board, 0) >> 8) & 0x7f);
+}
+
+//____________________________________________________________________
+//
+// EOF
+//
--- /dev/null
+#ifndef ALIFMDCALIBSTRIPRANGE_H
+#define ALIFMDCALIBSTRIPRANGE_H
+/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
+ * reserved.
+ *
+ * See cxx source for full Copyright notice
+ */
+/** @file AliFMDCalibStripRange.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 18:32:14 2006
+ @brief Per digitizer card pulser calibration
+*/
+#ifndef ROOT_TObject
+# include <TObject.h>
+#endif
+#ifndef ALIFMDUSHORTMAP_H
+# include "AliFMDUShortMap.h"
+#endif
+#ifndef ROOT_TArrayI
+# include <TArrayI.h>
+#endif
+//____________________________________________________________________
+/** @brief Per digitizer card pulser calibration
+ @ingroup FMD_base
+*/
+class AliFMDCalibStripRange : public TObject
+{
+public:
+ /** CTOR */
+ AliFMDCalibStripRange();
+ /** Copy CTOR
+ @param o Object to copy from */
+ AliFMDCalibStripRange(const AliFMDCalibStripRange& o);
+ /** Assignment operator
+ @param o Object to assign from
+ @return Reference to assign from */
+ AliFMDCalibStripRange& operator=(const AliFMDCalibStripRange& o);
+ /** Set sample for a DDL
+ @param det Detector #
+ @param ring Ring ID
+ @param sec Sector #
+ @param str Strip number (not used)
+ @param min Minimum strip (0-127)
+ @param max Maximum strip (0-127) */
+ void Set(UShort_t det, Char_t ring, UShort_t sec, UShort_t str,
+ UShort_t min, UShort_t max);
+ /** Get minimum strip read out (0-127)
+ @param det Detector #
+ @param ring Ring ID
+ @param sec Sector #
+ @param str Strip number (not used)
+ @return Minimum strip */
+ UShort_t Min(UShort_t det, Char_t ring, UShort_t sec, UShort_t str=0) const;
+ /** Get maximum strip read out (0-127)
+ @param det Detector #
+ @param ring Ring ID
+ @param sec Sector #
+ @param str Strip number (not used)
+ @return Maximum strip */
+ UShort_t Max(UShort_t det, Char_t ring, UShort_t sec, UShort_t str=0) const;
+protected:
+ // TArrayI fRates; // Sample rates
+ AliFMDUShortMap fRates;
+ ClassDef(AliFMDCalibStripRange,1); // Sample rates
+};
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+// mode: C++
+// End:
+//
+
+
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
+/** @file AliFMDDetector.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:36:27 2006
+ @brief Sub-detector base class implementation
+*/
//____________________________________________________________________
//
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDDetector.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:36:27 2006
+ @brief Sub-detector base class declaration
+*/
#ifndef ROOT_TNamed
# include <TNamed.h>
#endif
/** @defgroup FMD_base Basic classes */
//__________________________________________________________________
-/** Base class for the geometry description and parameters of the FMD
- sub detectors FMD1, FMD2, and FMD3.
+/** @brief Base class for the geometry description and parameters of
+ the FMD sub detectors FMD1, FMD2, and FMD3.
This class hold common parameters of the specific FMD detectors.
@ingroup FMD_base
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDDigit.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:37:41 2006
+ @brief Digits for the FMD
+*/
//////////////////////////////////////////////////////////////////////
//
// Digits classes for the FMD
#ifndef ALIFMDDIGIT_H
#define ALIFMDDIGIT_H
+/** @file AliFMDDigit.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:37:41 2006
+ @brief Digits for the FMD
+*/
//___________________________________________________________________
//
// Digits classes for the FMD
Short_t count3=-1);
/** DTOR */
virtual ~AliFMDDigit() {}
+ /** @param i # of sample to get
+ @return sample # @a i */
+ Int_t Count(size_t i=0) const;
/** @return ADC count (first sample) */
UShort_t Count1() const { return fCount1; }
/** @return ADC count (second sample, or -1 if not used) */
+ (fCount3 >= 0 ? fCount3 : 0);
}
+inline Int_t
+AliFMDDigit::Count(size_t i) const
+{
+ switch (i) {
+ case 0: return fCount1;
+ case 1: return fCount2;
+ case 2: return fCount3;
+ }
+ return -1;
+}
+
//____________________________________________________________________
/** @class AliFMDSDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
@brief class for summable digits
* 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
+*/
//////////////////////////////////////////////////////////////////////////////
//
// This class contains the procedures simulation ADC signal for the
UShort_t sector = fmdHit->Sector();
UShort_t strip = fmdHit->Strip();
Float_t edep = fmdHit->Edep();
-
+ UShort_t minstrip = param->GetMinStrip(detector, ring, sector, strip);
+ UShort_t maxstrip = param->GetMaxStrip(detector, ring, sector, strip);
// Check if strip is `dead'
- if (param->IsDead(detector, ring, sector, strip)) continue;
-
+ if (param->IsDead(detector, ring, sector, strip)) {
+ AliDebug(5, Form("FMD%d%c[%2d,%3d] is marked as dead",
+ detector, ring, sector, strip));
+ continue;
+ }
+ // Check if strip is out-side read-out range
+ if (strip < minstrip || strip > maxstrip) {
+ AliDebug(5, Form("FMD%d%c[%2d,%3d] is outside range [%3d,%3d]",
+ detector, ring, sector, strip, minstrip, maxstrip));
+ continue;
+ }
+
// Give warning in case of double hit
if (fEdep(detector, ring, sector, strip).fEdep != 0)
AliDebug(5, Form("Double hit in %d%c(%d,%d)",
Float_t convF = 1/param->GetPulseGain(detector,ring,sector,strip);
UShort_t ped = MakePedestal(detector,ring,sector,strip);
UInt_t maxAdc = param->GetAltroChannelSize();
- UShort_t rate = param->GetSampleRate(AliFMDParameters::kBaseDDL);
+ UShort_t rate = param->GetSampleRate(detector,ring,sector,strip);
UShort_t size = param->GetAltroChannelSize();
// In case we don't oversample, just return the end value.
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDDigitizer.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:38:26 2006
+ @brief FMD Digitizers declaration
+*/
#ifndef ALIDIGITIZER_H
# include <AliDigitizer.h>
#endif
* about the suitability of this software for any purpose. It is *
* 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
+*/
//___________________________________________________________________
//
// The classes defined here, are utility classes for reading in data
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDDisplay.h
+ @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
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDEdepMap.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:39:50 2006
+ @brief Per strip map of energy deposited and number of hits
+*/
//____________________________________________________________________
//
//
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDEdepMap.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:39:50 2006
+ @brief Per strip map of energy deposited and number of hits
+*/
#ifndef ALIFMDMAP_H
# include "AliFMDMap.h"
#endif
//____________________________________________________________________
-/** Cache of Energy deposited, hit information per strip.
+/** @brief Cache of Energy deposited, hit information per strip.
Contains a pair of energy deposited @c fEdep and
number of hits @c fN, @c fEdep is the summed energy deposition,
and @c fN is the number of hits
};
//____________________________________________________________________
-/** Map of Energy deposited, hit information per strip.
+/** @brief Map of Energy deposited, hit information per strip.
Contains a pair of energy deposited @c fEdep and
number of hits @c fN, @c fEdep is the summed energy deposition,
and @c fN is the number of hits */
* about the suitability of this software for any purpose. It is *
* 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
+*/
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers.
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDGeometry.h
+ @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.
//__________________________________________________________________
-/** Singleton object of FMD geometry descriptions and parameters.
+/** @brief Singleton object of FMD geometry descriptions and parameters.
This class is a singleton that handles the geometry parameters of
the FMD detectors.
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDGeometryBuilder.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:41:17 2006
+ @brief Class to build the FMD geometry
+*/
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers. This class
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDGeometryBuilder.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:41:17 2006
+ @brief Class to build the FMD geometry
+*/
#ifndef ROOT_TTask
# include <TTask.h>
#endif
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDHit.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:41:58 2006
+ @brief Hit in the FMD
+*/
//____________________________________________________________________
//
// Hits in the FMD
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDHit.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:41:58 2006
+ @brief Hit in the FMD
+*/
//___________________________________________________________________
//
#ifndef ALIHIT_H
#endif
//___________________________________________________________________
-/** AliFMDhit is the hit class for the FMD. Hits are the information
- that comes from a Monte Carlo at each step as a particle mass
- through sensitive detector elements as particles are transported
- through a detector.
+/** @brief AliFMDhit is the hit class for the FMD.
+ Hits are the information that comes from a Monte Carlo at each
+ step as a particle mass through sensitive detector elements as
+ particles are transported through a detector.
@ingroup FMD_sim
*/
class AliFMDHit : public AliHit
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDInput.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:42:40 2006
+ @brief FMD utility classes for reading FMD data
+*/
//___________________________________________________________________
//
// The classes defined here, are utility classes for reading in data
// Optionally, get the ESD files
if (TESTBIT(fTreeMask, kESD)) {
fChainE = new TChain("esdTree");
- TSystemDirectory dir;
+ TSystemDirectory dir(".",".");
TList* files = dir.GetListOfFiles();
- TSystemFile* file;
+ TSystemFile* file = 0;
+ if (!files) {
+ AliError("No files");
+ return kFALSE;
+ }
files->Sort();
TIter next(files);
while ((file = static_cast<TSystemFile*>(next()))) {
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDInput.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:42:40 2006
+ @brief FMD utility classes for reading FMD data
+*/
//___________________________________________________________________
/** @defgroup FMD_util Utility classes.
//____________________________________________________________________
class AliFMDHit;
+/** @brief Class to read FMD hits
+ */
class AliFMDInputHits : public AliFMDInput
{
public:
+ /** Constructor
+ @param file Name of @c gAlice file */
AliFMDInputHits(const char* file="galice.root")
: AliFMDInput(file) { AddLoad(kHits); }
ClassDef(AliFMDInputHits, 0);
//____________________________________________________________________
class AliFMDDigit;
+/** @brief Class to read FMD digits
+ */
class AliFMDInputDigits : public AliFMDInput
{
public:
+ /** Constructor
+ @param file Name of @c gAlice file */
AliFMDInputDigits(const char* file="galice.root")
: AliFMDInput(file) { AddLoad(kDigits); }
ClassDef(AliFMDInputDigits, 0);
//____________________________________________________________________
class AliFMDSDigit;
+/** @brief Class to read FMD summable digits
+ */
class AliFMDInputSDigits : public AliFMDInput
{
public:
+ /** Constructor
+ @param file Name of @c gAlice file */
AliFMDInputSDigits(const char* file="galice.root")
: AliFMDInput(file) { AddLoad(kSDigits); }
ClassDef(AliFMDInputSDigits, 0);
};
//____________________________________________________________________
+/** @brief Class to read FMD raw data
+ */
class AliFMDInputRaw : public AliFMDInput
{
public:
+ /** Constructor
+ @param file Name of @c gAlice file */
AliFMDInputRaw(const char* file="galice.root")
: AliFMDInput(file) { AddLoad(kRaw); }
ClassDef(AliFMDInputRaw, 0);
//____________________________________________________________________
class AliFMDRecPoint;
+/** @brief Class to read FMD reconstructed data
+ */
class AliFMDInputRecPoints : public AliFMDInput
{
public:
+ /** Constructor
+ @param file Name of @c gAlice file */
AliFMDInputRecPoints(const char* file="galice.root")
: AliFMDInput(file) { AddLoad(kRecPoints); }
ClassDef(AliFMDInputRecPoints, 0);
* 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
+*/
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers.
#include "AliFMDRing.h" // ALIFMDRING_H
#include "AliFMDCalibGain.h" // ALIFMDCALIBGAIN_H
#include "AliFMDCalibPedestal.h" // ALIFMDCALIBPEDESTAL_H
-#include "AliFMDCalibSampleRate.h" // ALIFMDCALIBPEDESTAL_H
+#include "AliFMDCalibSampleRate.h" // ALIFMDCALIBSAMPLERATE_H
+#include "AliFMDCalibStripRange.h" // ALIFMDCALIBSTRIPRANGE_H
#include "AliFMDAltroMapping.h" // ALIFMDALTROMAPPING_H
#include <AliCDBManager.h> // ALICDBMANAGER_H
#include <AliCDBEntry.h> // ALICDBMANAGER_H
const char* AliFMDParameters::fgkSampleRate = "FMD/Calib/SampleRate";
const char* AliFMDParameters::fgkAltroMap = "FMD/Calib/AltroMap";
const char* AliFMDParameters::fgkZeroSuppression = "FMD/Calib/ZeroSuppression";
+const char* AliFMDParameters::fgkStripRange = "FMD/Calib/StripRange";
//____________________________________________________________________
fPedestal(0),
fPulseGain(0),
fDeadMap(0),
- fAltroMap(0)
+ fAltroMap(0),
+ fStripRange(0)
{
// Default constructor
SetVA1MipRange();
SetPedestalWidth();
SetPedestalFactor();
SetThreshold();
+ SetStripRange();
}
//__________________________________________________________________
fIsInit = kTRUE;
}
+
+//__________________________________________________________________
+void
+AliFMDParameters::Print(Option_t* option) const
+{
+ TString opt(option);
+ Bool_t showStrips = opt.Contains("a", TString::kIgnoreCase);
+ for (UShort_t det=1 ; det <= 3; det++) {
+ std::cout << "FMD" << det << std::endl;
+ Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'), '\0' };
+ for (Char_t* ring = rings; *ring != '\0'; ring++) {
+ std::cout << " Ring " << *ring << std::endl;
+ UShort_t nSec = ( *ring == 'I' ? 20 : 40 );
+ UShort_t nStr = ( *ring == 'I' ? 512 : 256 );
+ for (UShort_t sec = 0; sec < nSec; sec++) {
+ UShort_t min = GetMinStrip(det, *ring, sec, 0);
+ UShort_t max = GetMaxStrip(det, *ring, sec, 0);
+ UShort_t rate = GetSampleRate(det, *ring, sec, 0);
+ std::cout << " Sector " << std::setw(2) << sec
+ << " Strip range: " << std::setw(3) << min << ","
+ << std::setw(3) << max << " Rate: " << std::setw(2)
+ << rate << std::endl;
+ if (!showStrips) continue;
+ std::cout
+ << " Strip | Pedestal | Gain | ZS thr. | Address\n"
+ << "--------+-------------------+----------+---------+---------"
+ << std::endl;
+ for (UShort_t str = 0; str < nStr; str++) {
+ std::cout << " " << std::setw(3) << str << " | ";
+ if (IsDead(det, *ring, sec, str)) {
+ std::cout << "dead" << std::endl;
+ continue;
+ }
+ UInt_t ddl, addr;
+ Detector2Hardware(det, *ring, sec, str, ddl, addr);
+ std::cout << std::setw(7) << GetPedestal(det, *ring, sec, str)
+ << "+/-" << std::setw(7)
+ << GetPedestalWidth(det, *ring, sec, str)
+ << " | " << std::setw(8)
+ << GetPulseGain(det, *ring, sec, str)
+ << " | " << std::setw(5)
+ << GetZeroSuppression(det, *ring, sec, str)
+ << " | 0x" << std::hex << std::setw(4)
+ << std::setfill('0') << ddl << ",0x" << std::setw(3)
+ << addr << std::dec << std::setfill(' ') << std::endl;
+ }
+ }
+ }
+ }
+}
+
+//__________________________________________________________________
+void
+AliFMDParameters::SetStripRange(UShort_t min, UShort_t max)
+{
+ fFixedMinStrip = min;
+ fFixedMaxStrip = max;
+}
+
//__________________________________________________________________
void
AliFMDParameters::InitPulseGain()
}
}
+//__________________________________________________________________
+void
+AliFMDParameters::InitStripRange()
+{
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliCDBEntry* range = cdb->Get(fgkStripRange);
+ if (!range) {
+ AliWarning(Form("No %s found in CDB, perhaps you need to "
+ "use AliFMDCalibFaker?", fgkStripRange));
+ return;
+ }
+ AliDebug(1, Form("Got strip range from CDB"));
+ fStripRange = dynamic_cast<AliFMDCalibStripRange*>(range->GetObject());
+ if (!fStripRange) AliWarning("Invalid strip range object from CDB");
+}
+
//__________________________________________________________________
Float_t
//__________________________________________________________________
UShort_t
-AliFMDParameters::GetSampleRate(UShort_t ddl) const
+AliFMDParameters::GetSampleRate(UShort_t det, Char_t ring, UShort_t sector,
+ UShort_t str) const
{
if (!fSampleRate) return fFixedSampleRate;
// Need to map sector to digitizier card.
- AliDebug(50, Form("Sample rate for %d=%d", ddl, fSampleRate->Rate(ddl)));
- return fSampleRate->Rate(ddl);
+ UInt_t ret = fSampleRate->Rate(det, ring, sector, str);
+ AliDebug(50, Form("Sample rate for FMD%d%c[%2d,%3d]=%d",
+ det, ring, sector, str, ret));
+ return ret;
+}
+
+//__________________________________________________________________
+UShort_t
+AliFMDParameters::GetMinStrip(UShort_t det, Char_t ring, UShort_t sector,
+ UShort_t str) const
+{
+ if (!fStripRange) return fFixedMinStrip;
+ // Need to map sector to digitizier card.
+ UInt_t ret = fStripRange->Min(det, ring, sector, str);
+ AliDebug(50, Form("Min strip # for FMD%d%c[%2d,%3d]=%d",
+ det, ring, sector, str, ret));
+ return ret;
+}
+
+//__________________________________________________________________
+UShort_t
+AliFMDParameters::GetMaxStrip(UShort_t det, Char_t ring, UShort_t sector,
+ UShort_t str) const
+{
+ if (!fStripRange) return fFixedMaxStrip;
+ // Need to map sector to digitizier card.
+ UInt_t ret = fStripRange->Max(det, ring, sector, str);
+ AliDebug(50, Form("Max strip # for FMD%d%c[%2d,%3d]=%d",
+ det, ring, sector, str, ret));
+ return ret;
}
//__________________________________________________________________
*
* See cxx source for full Copyright notice
*/
-
+/** @file AliFMDParameters.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:44:43 2006
+ @brief Manager of FMD parameters
+*/
//____________________________________________________________________
//
// Singleton class to handle various parameters (not geometry) of the
class AliFMDCalibPedestal;
class AliFMDCalibGain;
class AliFMDCalibSampleRate;
+class AliFMDCalibStripRange;
class AliFMDAltroMapping;
-/** This class is a singleton that handles various parameters of the
- FMD detectors. This class reads from the Conditions DB to get the
- various parameters, which code can then request from here. In that
- way, all code uses the same data, and the interface is consistent.
+/** @brief This class is a singleton that handles various parameters
+ of the FMD detectors.
+ This class reads from the Conditions DB to get the various
+ parameters, which code can then request from here. In that way,
+ all code uses the same data, and the interface is consistent.
Some of the parameter managed are
- @c fPedestal, @c fPedestalWidth
CDB. If that fails, the class uses the hard-coded parameters.
*/
void Init();
+ /** Print all parameters.
+ @param option Option string */
+ void Print(Option_t* option="A") const;
/** @{ */
/** @name Set various `Fixed' parameters */
+ /** @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 */
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. */
void SetChannelsPerAltro(UShort_t size=128) { fChannelsPerAltro = size; }
+ /** @param f Factor to use for accepting a signal. */
void SetPedestalFactor(Float_t f=3) { fPedestalFactor = f; }
/** @} */
/** @{ */
/** @name Set various variable parameter defaults */
+ /** @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. */
void SetSampleRate(UShort_t r=1) { fFixedSampleRate = (r>2?2:r);}
+ /** @param p Pedestal value in ADC counts */
void SetPedestal(Float_t p=10) { fFixedPedestal = p; }
+ /** @param w Pedestal width in ADC counts */
void SetPedestalWidth(Float_t w=1) { fFixedPedestalWidth = w; }
+ /** @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). */
+ void SetStripRange(UShort_t min=0, UShort_t max=127);
/** @} */
/** @{ */
/** @name Get `Fixed' various parameters */
+ /** @return Number of MIP signals that fit inside a VA1 channel */
UShort_t GetVA1MipRange() const { return fVA1MipRange; }
+ /** @return The maximum count in the ADC */
UShort_t GetAltroChannelSize() const { return fAltroChannelSize; }
+ /** @return Number of strips muliplexed into one ADC channel */
UShort_t GetChannelsPerAltro() const { return fChannelsPerAltro; }
+ /** @return The average energy deposited by one MIP */
Float_t GetEdepMip() const;
+ /** @return The factor used of signal acceptance */
Float_t GetPedestalFactor() const { return fPedestalFactor; }
/** @} */
/** @{ */
/** @name Get variable parameters */
+ /** 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;
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. */
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 */
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 */
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) */
UShort_t GetZeroSuppression(UShort_t detector,
Char_t ring,
UShort_t sector,
UShort_t strip) const;
- UShort_t GetSampleRate(UShort_t ddl) 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 */
+ 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 */
+ 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 */
+ UShort_t GetMaxStrip(UShort_t detector,
+ Char_t ring,
+ UShort_t sector,
+ UShort_t strip) 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(UInt_t ddl, UInt_t addr, UShort_t& det,
Char_t& ring, UShort_t& sec, UShort_t& str) 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, UInt_t& ddl, UInt_t& addr) const;
+ /** Get the map that translates hardware to detector coordinates
+ @return Get the map that translates hardware to detector
+ coordinates */
AliFMDAltroMapping* GetAltroMap() const;
/** @} */
static const char* fgkSampleRate; // Path to SampleRate calib object
static const char* fgkAltroMap; // Path to AltroMap calib object
static const char* fgkZeroSuppression; // Path to ZeroSuppression cal object
+ static const char* fgkStripRange; // Path to strip range cal object
protected:
/** CTOR */
AliFMDParameters();
void InitZeroSuppression();
/** Initialize hardware map. Try to get it from CDB */
void InitAltroMap();
+ /** Initialize strip range. Try to get it from CDB */
+ void InitStripRange();
Bool_t fIsInit; // Whether we've been initialised
UShort_t fFixedZeroSuppression; // Threshold for zero-suppression
UShort_t fFixedSampleRate; // Times the ALTRO samples pre-amp.
Float_t fFixedThreshold; //
+ UShort_t fFixedMinStrip;
+ UShort_t fFixedMaxStrip;
mutable Float_t fFixedPulseGain; //! Gain (cached)
mutable Float_t fEdepMip; //! Cache of energy loss for a MIP
AliFMDCalibGain* fPulseGain; // Pulser gain
AliFMDCalibDeadMap* fDeadMap; // Pulser gain
AliFMDAltroMapping* fAltroMap; // Map of hardware
+ AliFMDCalibStripRange* fStripRange; // Strip range
- ClassDef(AliFMDParameters,3)
+ ClassDef(AliFMDParameters,4)
};
#endif
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDRawReader.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:45:23 2006
+ @brief Class to read raw data
+*/
//____________________________________________________________________
//
// Class to read ADC values from a AliRawReader object.
#include "AliFMDRawStream.h" // ALIFMDRAWSTREAM_H
#include "AliRawReader.h" // ALIRAWREADER_H
#include "AliFMDRawReader.h" // ALIFMDRAWREADER_H
-#include "AliFMDAltroIO.h" // ALIFMDALTROIO_H
+// #include "AliFMDAltroIO.h" // ALIFMDALTROIO_H
#include <TArrayI.h> // ROOT_TArrayI
#include <TTree.h> // ROOT_TTree
#include <TClonesArray.h> // ROOT_TClonesArray
// Default CTOR
}
+//____________________________________________________________________
+void
+AliFMDRawReader::Exec(Option_t*)
+{
+ TClonesArray* array = new TClonesArray("AliFMDDigit");
+ if (!fTree) {
+ AliError("No tree");
+ return;
+ }
+ fTree->Branch("FMD", &array);
+ ReadAdcs(array);
+ Int_t nWrite = fTree->Fill();
+ AliDebug(1, Form("Got a grand total of %d digits, wrote %d bytes to tree",
+ array->GetEntries(), nWrite));
+}
+
+
+#if 1
+//____________________________________________________________________
+Bool_t
+AliFMDRawReader::ReadAdcs(TClonesArray* array)
+{
+ // Read raw data into the digits array, using AliFMDAltroReader.
+ if (!array) {
+ AliError("No TClonesArray passed");
+ return kFALSE;
+ }
+ if (!fReader->ReadHeader()) {
+ AliError("Couldn't read header");
+ return kFALSE;
+ }
+ // Get sample rate
+ AliFMDParameters* pars = AliFMDParameters::Instance();
+ AliFMDRawStream input(fReader);
+ // Select FMD DDL's
+ fReader->Select(AliFMDParameters::kBaseDDL>>8);
+
+ UShort_t stripMin = 0;
+ UShort_t stripMax = 127;
+ UShort_t preSamp = 0;
+
+ UInt_t ddl = 0;
+ UInt_t rate = 0;
+ UInt_t last = 0;
+ UInt_t hwaddr = 0;
+ // Data array is approx twice the size needed.
+ UShort_t data[2048];
+ while (input.ReadChannel(ddl, hwaddr, last, data)) {
+ AliDebug(5, Form("Read channel 0x%x of size %d", hwaddr, last));
+ UShort_t det, sec, str;
+ Char_t ring;
+ if (!pars->Hardware2Detector(ddl, hwaddr, det, ring, sec, str)) {
+ AliError(Form("Failed to get detector id from DDL %d "
+ "and hardware address 0x%x", ddl, hwaddr));
+ continue;
+ }
+ rate = pars->GetSampleRate(det, ring, sec, str);
+ stripMin = pars->GetMinStrip(det, ring, sec, str);
+ stripMax = pars->GetMaxStrip(det, ring, sec, str);
+ AliDebug(5, Form("DDL 0x%04x, address 0x%03x maps to FMD%d%c[%2d,%3d]",
+ ddl, hwaddr, det, ring, sec, str));
+
+ // Loop over the `timebins', and make the digits
+ for (size_t i = 0; i < last; i++) {
+ if (i < preSamp) continue;
+ Int_t n = array->GetEntries();
+ UShort_t curStr = str + stripMin + i / rate;
+ if ((curStr-str) > stripMax) {
+ AliError(Form("Current strip is %d but DB says max is %d",
+ curStr, stripMax));
+ }
+ AliDebug(5, Form("making digit for FMD%d%c[%2d,%3d] from sample %4d",
+ det, ring, sec, curStr, i));
+ new ((*array)[n]) AliFMDDigit(det, ring, sec, curStr, data[i],
+ (rate >= 2 ? data[i+1] : 0),
+ (rate >= 3 ? data[i+2] : 0));
+ if (rate >= 2) i++;
+ if (rate >= 3) i++;
+ }
+ }
+ return kTRUE;
+}
+#else
//____________________________________________________________________
Bool_t
AliFMDRawReader::ReadAdcs(TClonesArray* array)
if (!fReader->ReadNextData(cdata)) break;
size_t nchar = fReader->GetDataSize();
UShort_t ddl = AliFMDParameters::kBaseDDL + fReader->GetDDLID();
- UShort_t rate = pars->GetSampleRate(ddl);
+ UShort_t rate = 0;
AliDebug(1, Form("Reading %d bytes (%d 10bit words) from %d",
nchar, nchar * 8 / 10, ddl));
// Make a stream to read from
"and hardware address 0x%x", ddl, hwaddr));
continue;
}
+ rate = pars->GetSampleRate(det, ring, sec, str);
+ stripMin = pars->GetMinStrip(det, ring, sec, str);
+ stripMax = pars->GetMaxStrip(det, ring, sec, str);
AliDebug(5, Form("DDL 0x%04x, address 0x%03x maps to FMD%d%c[%2d,%3d]",
ddl, hwaddr, det, ring, sec, str));
-//____________________________________________________________________
-void
-AliFMDRawReader::Exec(Option_t*)
-{
- TClonesArray* array = new TClonesArray("AliFMDDigit");
- if (!fTree) {
- AliError("No tree");
- return;
- }
- fTree->Branch("FMD", &array);
- ReadAdcs(array);
- Int_t nWrite = fTree->Fill();
- AliDebug(1, Form("Got a grand total of %d digits, wrote %d bytes to tree",
- array->GetEntries(), nWrite));
-}
-
-#if 0
// This is the old method, for comparison. It's really ugly, and far
// too convoluted.
//____________________________________________________________________
* See cxx source for full Copyright notice
*/
/* $Id$ */
+/** @file AliFMDRawReader.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:45:23 2006
+ @brief Class to read raw data
+*/
//____________________________________________________________________
//
// Class to read ADC values from a AliRawReader object.
//
#include "AliFMDRawStream.h" // ALIFMDRAWSTREAM_H
#include <AliRawReader.h> // ALIRAWREADER_H
+#include "AliFMDParameters.h"
#include <AliLog.h>
#include <iomanip>
#include <iostream>
#endif
//____________________________________________________________________
-AliFMDRawStream::AliFMDRawStream(AliRawReader* reader, UShort_t sampleRate)
- : AliAltroRawStream(reader),
- fSampleRate(sampleRate),
- fPrevTime(-1),
- fExplicitSampleRate(kFALSE),
- fPos(0),
- fCur(0),
- fRead(0)
+AliFMDRawStream::AliFMDRawStream(AliRawReader* reader)
+ : AliAltroRawStream(reader)
{
- if (fSampleRate > 0) fExplicitSampleRate = kTRUE;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliFMDRawStream::ReadTrailer(UInt_t& addr, UInt_t& len)
-{
- if (fPos <= 0) return 0;
- if (fPos < 4) {
- AliError("could not read trailer");
- return -1;
- }
- AliDebug(1, Form("Reading a trailer at %d", fPos));
- Int_t temp = Get10BitWord();
- if (temp != 0x2AA) {
- AliError(Form("Incorrect trailer! Expected 0x2AA but got %x!",temp));
- return -1;
- }
- temp = Get10BitWord();
- if ((temp >> 6) != 0xA) {
- AliError(Form("Incorrect trailer! Expected 0xA but got %x!",temp >> 6));
- return -1;
- }
-
- len = (temp << 4) & 0x3FF;
- temp = Get10BitWord();
- len |= (temp >> 6);
- if (((temp >> 2) & 0xF) != 0xA) {
- AliError(Form("Incorrect trailer! Expected 0xA but got %x!",temp >> 6));
- return -1;
- }
- addr = (temp & 0x3) << 10;
- temp = Get10BitWord();
- addr |= temp;
-
- return 4;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliFMDRawStream::ReadFillWords(UInt_t len)
-{
- if (len % 4 == 0) return 0;
- Int_t nFill = (4 - (len % 4)) % 4;
- AliDebug(1, Form("Reading %d fill words", nFill));
- for (Int_t i = 0; i < nFill; i++) {
- UInt_t fill = Get10BitWord();
- if (fill != 0x2AA) {
- AliError(Form("Invalid fill! Expected 0x2AA, but got %X!", fill));
- return -1;
- }
- }
- return nFill;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliFMDRawStream::ReadBunch(UShort_t* data)
-{
- AliDebug(1, "Reading a bunch");
- if (fPos <= 0) {
- AliError("could not read bunch length");
- return -1;
- }
- UShort_t len = Get10BitWord();
- if (fPos <= 0) {
- AliError("could not read bunch length");
- return -1;
- }
- UShort_t time = Get10BitWord();
-
- AliDebug(1, Form("Bunch is %d long and ends at t=%d", len, time));
- for (UInt_t i = 2; i < len; i++) {
- Int_t amp = Get10BitWord();
- if (amp < 0) {
- AliError(Form("Bad adc value (%X) !", amp));
- return -1;
- }
- data[time - (i-2)] = amp;
- }
- return len;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliFMDRawStream::ReadIntoBuffer()
-{
- if (fPos > 0) return kTRUE;
- do {
- AliDebug(1, Form("Reading into the buffer"));
- if (!fRawReader->ReadNextData(fRead)) return -1;
- } while (fRawReader->GetDataSize() == 0);
- fPos = (fRawReader->GetDataSize() * 8) / 10;
- // Skip trailing `0x2AA's - is this needed? Won't it break the
- // trailer?
-#if 0
- UShort_t skip;
- while ((skip = Get10BitWord()) != 0x2AA)
- AliDebug(1,Form("Skipping one %x", skip));
-#endif
- fPos++;
- return fPos;
-}
-
-//_____________________________________________________________________________
-Bool_t
-AliFMDRawStream::ReadChannel(UInt_t& addr, UInt_t& len, UShort_t* data)
-{
- Int_t ret = 0;
- AliDebug(1, "Reading a channel");
- if ((ret = ReadIntoBuffer()) < 0) return kFALSE;
- if ((ret = ReadTrailer(addr, len)) < 0) return kFALSE;
- if ((ret = ReadFillWords(len)) < 0) return kFALSE;
- Int_t toRead = len;
- while (toRead > 0) {
- if ((ret = ReadBunch(data)) < 0) return kFALSE;
- toRead -= ret;
- }
- len -= 2;
- return kTRUE;
+ fNoAltroMapping = kFALSE;
}
//_____________________________________________________________________________
Bool_t
-AliFMDRawStream::DumpData()
+AliFMDRawStream::ReadChannel(UInt_t& ddl, UInt_t& addr,
+ UInt_t& len, UShort_t* data)
{
- Int_t ret;
- if ((ret = ReadIntoBuffer()) < 0) return kFALSE;
- UShort_t data;
- Int_t i = 0;
- while ((data = Get10BitWord()) != 0xffff) {
- if (i % 4 == 0) {
- if (i != 0) std::cout << "\n";
- std::cout << std::setw(6) << i << ":";
+ UInt_t prevddl = 0;
+ Int_t l = 0;
+ static Int_t last = 0xFFFF; // 0xFFFF means signal is used
+ Bool_t next = kTRUE;
+ do {
+ Int_t signal = last;
+ if (last > 0x3FF) {
+ AliDebug(30, Form("Last is 0x%x, so reading a new word", last));
+ next = Next();
+ if (!next) break;
+ signal = GetSignal();
+ if (GetHWAddress() != GetPrevHWAddress() && GetPrevHWAddress() >= 0) {
+ AliDebug(15, Form("New hardware address, was 0x%x, now 0x%x",
+ GetPrevHWAddress(), GetHWAddress()));
+ addr = GetPrevHWAddress();
+ ddl = AliFMDParameters::kBaseDDL + prevddl;
+ len = l+1;
+ last = signal;
+ break;
+ }
}
- std::cout << " 0x" << std::setfill('0') << std::setw(3)
- << std::hex << data << std::dec << std::setfill(' ')
- << std::flush;
- i++;
- }
- return kTRUE;
+ prevddl = fRawReader->GetDDLID();
+ Int_t t = GetTime();
+ l = TMath::Max(l, t);
+ data[t] = signal;
+ last = 0xFFFF;
+ } while (next);
+ return next;
}
-//_____________________________________________________________________________
-UShort_t
-AliFMDRawStream::Get10BitWord()
-{
- // return a word in a 10 bit array as an UShort_t
- --fPos;
- if (fPos < 0) {
- AliWarning("At high water mark");
- return 0xFFFF;
- }
- Int_t iBit = fPos * 10;
- Int_t iByte = iBit / 8;
- Int_t shift = iBit % 8;
- // return ((buffer[iByte+1] * 256 + buffer[iByte]) >> shift) & 0x03FF;
-
- // recalculate the byte numbers and the shift because
- // the raw data is written as integers where the high bits are filled first
- // -> little endian is assumed here !
- Int_t iByteHigh = 4 * (iByte / 4) + 3 - (iByte % 4);
- iByte++;
- Int_t iByteLow = 4 * (iByte / 4) + 3 - (iByte % 4);
- shift = 6 - shift;
- return ((fRead[iByteHigh] * 256 + fRead[iByteLow]) >> shift) & 0x03FF;
-}
-
-//_____________________________________________________________________________
-Bool_t
-AliFMDRawStream::Next()
-{
- // read the next raw digit
- // returns kFALSE if there is no digit left
- fPrevTime = fTime;
- if (AliAltroRawStream::Next()) {
- if (!fExplicitSampleRate && fPrevPad != fPad)
- fSampleRate = fTimeBunch / 128;
- return kTRUE;
- }
- return kFALSE;
-}
//_____________________________________________________________________________
//
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDRawStream.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Tue Mar 28 12:53:26 2006
+ @brief Class to read ALTRO formated data from an AliRawReader.
+*/
#ifndef ALIALTRORAWSTREAM_H
# include <AliAltroRawStream.h>
#endif
-// TPC to FMD translations
-//
-// TPC FMD
-// ----------+-----------
-// pad+time | strip
-// row | sector
-// sector | ring
-//
+/** @class AliFMDRawStream
+ @brief Class to read ALTRO formated data from an AliRawReader.
+ This class is mostly here to set
+ AliAltroRawStream::fNoAltroMapping to false. Furthermore, it
+ defines the utility function ReadChannel to read in a full ALTRO
+ channel. The data is unpacked into the passed array.
+ */
class AliFMDRawStream : public AliAltroRawStream
{
public:
- AliFMDRawStream(AliRawReader* reader, UShort_t sampleRate=0);
+ /** Constructor
+ @param reader Raw reader to use */
+ AliFMDRawStream(AliRawReader* reader);
+ /** Destructor */
virtual ~AliFMDRawStream() {}
- Short_t Sector() const { return fRow; }
- Char_t Ring() const { return (fSector == 0 ? 'I' : 'O'); }
- Short_t Strip() const { return fPad + fTime / fSampleRate; }
- Short_t Sample() const { return fTime % fSampleRate; }
- Short_t PrevSector() const { return fPrevRow; }
- Char_t PrevRing() const { return (fPrevSector == 0 ? 'I' : 'O'); }
- Short_t PrevStrip() const { return fPrevPad + fPrevTime/fSampleRate; }
-
- Bool_t IsNewRing() const { return (fSector != fPrevSector); }
- Bool_t IsNewSector() const { return (fRow != fPrevRow) || IsNewRing(); }
- Bool_t IsNewStrip() const { return(Strip() != PrevStrip())||IsNewSector();}
-
- Short_t Count() const { return fSignal; }
- Short_t SampleRate() const { return fSampleRate; }
-
- virtual Bool_t Next();
- virtual Bool_t ReadChannel(UInt_t& addr, UInt_t& len, UShort_t* data);
- virtual Bool_t DumpData();
+ /** Read one ALTRO channel from the raw reader
+ @param ddl On return, the DDL
+ @param addr On return, the hardware address
+ @param len On return, the number of entries filled in @a data
+ @param data On return, the read ADC channels.
+ @return @c true on success */
+ virtual Bool_t ReadChannel(UInt_t& ddl, UInt_t& addr,
+ UInt_t& len, UShort_t* data);
protected:
- virtual Int_t ReadIntoBuffer();
- virtual Int_t ReadTrailer(UInt_t& head, UInt_t& len);
- virtual Int_t ReadFillWords(UInt_t len);
- virtual Int_t ReadBunch(UShort_t* data);
- virtual UShort_t Get10BitWord();
+ /** @{ */
+ /** @name Hide base classes `stupid' member functions */
+ Int_t GetSector() const { return -1; }
+ Int_t GetPrevSector() const { return -1; }
+ Bool_t IsNewSector() const { return kFALSE; }
+ Int_t GetRow() const { return -1; }
+ Int_t GetPrevRow() const { return -1; }
+ Bool_t IsNewRow() const { return kFALSE; }
+ Int_t GetPad() const { return -1; }
+ Int_t GetPrevPad() const { return -1; }
+ Bool_t IsNewPad() const { return kFALSE; }
+ /** @} */
- UShort_t fSampleRate; // # of ALTRO samples per VA1_ALICE clock
- Int_t fPrevTime; // Last time bin
- Bool_t fExplicitSampleRate; // True if the sample rate was set externally
- Int_t fPos;
- Int_t fCur;
- UChar_t* fRead;
ClassDef(AliFMDRawStream, 0) // Read raw FMD Altro data
};
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDRawWriter.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:45:56 2006
+ @brief Class to write raw data
+*/
//____________________________________________________________________
//
// Class to write ADC values to a raw data file
#include "AliFMDDigit.h" // ALIFMDDIGIT_H
#include "AliFMDRawWriter.h" // ALIFMDRAWREADER_H
#include "AliFMDAltroMapping.h" // ALIFMDALTROMAPPING_H
-#include "AliFMDAltroIO.h" // ALIFMDALTROWRITER_H
+// #include "AliFMDAltroIO.h" // ALIFMDALTROWRITER_H
#include <TArrayI.h> // ROOT_TArrayI
#include <TClonesArray.h> // ROOT_TClonesArray
#include <fstream>
AliFMDRawWriter::AliFMDRawWriter(AliFMD* fmd)
: TTask("FMDRawWriter", "Writer of Raw ADC values from the FMD"),
fFMD(fmd)
-{
- AliFMDParameters* pars = AliFMDParameters::Instance();
- fSampleRate = pars->GetSampleRate(AliFMDParameters::kBaseDDL);
- fChannelsPerAltro = pars->GetChannelsPerAltro();
-}
+{}
//____________________________________________________________________
// 10-bit word, and the samples are grouped into 40-bit blocks
//
// +------------------------------------+
- // | S(n) | S(n-1) | S(n-2) | S(n-3) |
+ // | S(1) | S(2) | S(3) | S(4) |
// | ... | ... | ... | ... |
- // | S(2) | S(1) | AA | AA |
+ // | S(n) | T(n) | n+2 | 2AA |
// +------------------------------------+
// Counts + possible filler
//
// words, packed into 40-bits.
//
// +------------------------------------+
- // | # words | start | sector | ring |
+ // | 2AAA | Len | A | Address |
// +------------------------------------+
// Trailer
//
loader->UnloadDigits();
}
+#if 1
+//____________________________________________________________________
+void
+AliFMDRawWriter::WriteDigits(TClonesArray* digits)
+{
+ Int_t nDigits = digits->GetEntries();
+ if (nDigits < 1) return;
+
+ AliFMDParameters* pars = AliFMDParameters::Instance();
+ UShort_t threshold = 0;
+ UInt_t prevddl = 0;
+ UInt_t prevaddr = 0xFFF;
+ // UShort_t prevStrip = 0;
+
+ // Which channel number in the ALTRO channel we're at
+ UShort_t nWords = 0;
+ UShort_t preSamples = 0;
+
+ // How many times the ALTRO Samples one VA1_ALICE channel
+ Int_t sampleRate = 1;
+
+ // A buffer to hold 1 ALTRO channel - Normally, one ALTRO channel
+ // holds 128 VA1_ALICE channels, sampled at a rate of `sampleRate'
+ TArrayI data(pars->GetChannelsPerAltro() * 8);
+
+ // The Altro buffer
+ AliAltroBuffer* altro = 0;
+
+ // Loop over the digits in the event. Note, that we assume the
+ // the digits are in order in the branch. If they were not, we'd
+ // have to cache all channels before we could write the data to
+ // the ALTRO buffer, or we'd have to set up a map of the digits.
+ for (Int_t i = 0; i < nDigits; i++) {
+ // Get the digit
+ AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
+
+ UShort_t det = digit->Detector();
+ Char_t ring = digit->Ring();
+ UShort_t sector = digit->Sector();
+ UShort_t strip = digit->Strip();
+ UInt_t ddl;
+ UInt_t addr;
+ threshold = pars->GetZeroSuppression(det, ring, sector, strip);
+ if (!pars->Detector2Hardware(det, ring, sector, strip, ddl, addr)) {
+ AliError(Form("Failed to get hardware address for FMD%d%c[%2d,%3d]",
+ det, ring, sector, strip));
+ continue;
+ }
+ if (addr != prevaddr) {
+ // Flush a channel to output
+ AliDebug(15, Form("Now hardware address 0x%x from FMD%d%c[%2d,%3d] "
+ "(board 0x%x, chip 0x%x, channel 0x%x), flushing old "
+ "channel at 0x%x with %d words",
+ addr, det, ring, sector, strip,
+ (addr >> 7), (addr >> 4) & 0x7, addr & 0xf,
+ prevaddr, nWords));
+ if (altro) altro->WriteChannel(prevaddr,nWords,data.fArray,threshold);
+ nWords = preSamples;
+ prevaddr = addr;
+ for (size_t i = 0; i < nWords; i++) data[i] = digit->Count(0);
+ }
+ if (ddl != prevddl) {
+ AliDebug(15, Form("FMD: New DDL, was %d, now %d", prevddl, ddl));
+ // If an altro exists, delete the object, flushing the data to
+ // disk, and closing the file.
+ if (altro) {
+ // When the first argument is false, we write the real
+ // header.
+ AliDebug(15, Form("Closing output"));
+ altro->Flush();
+ altro->WriteDataHeader(kFALSE, kFALSE);
+ delete altro;
+ altro = 0;
+ }
+ prevddl = ddl;
+ // Need to open a new DDL!
+ TString filename(Form("%s_%d.ddl", fFMD->GetName(), ddl));
+ AliDebug(15, Form("New altro buffer with DDL file %s", filename.Data()));
+ // Create a new altro buffer - a `1' as the second argument
+ // means `write mode'
+ altro = new AliAltroBuffer(filename.Data(), 1);
+ altro->SetMapping(pars->GetAltroMap());
+ // Write a dummy (first argument is true) header to the DDL
+ // file - later on, when we close the file, we write the real
+ // header
+ altro->WriteDataHeader(kTRUE, kFALSE);
+ }
+
+ // Store the counts of the ADC in the channel buffer
+ sampleRate = pars->GetSampleRate(det, ring, sector, strip);
+ for (int s = 0; s < sampleRate; s++) {
+ data[nWords] = digit->Count(s);
+ nWords++;
+ }
+ }
+ // Finally, we need to close the final ALTRO buffer if it wasn't
+ // already
+ if (altro) {
+ if (nWords > 0) altro->WriteChannel(prevaddr,nWords,data.fArray,threshold);
+ altro->Flush();
+ altro->WriteDataHeader(kFALSE, kFALSE);
+ delete altro;
+ }
+}
+#else
//____________________________________________________________________
void
AliFMDRawWriter::WriteDigits(TClonesArray* digits)
}
writer = new AliFMDAltroWriter(*file);
writer->SetThreshold(pars->GetZeroSuppression(det, ring, sector, strip));
- sampleRate = pars->GetSampleRate(ddl);
}
// Write out our signal
+ sampleRate = pars->GetSampleRate(det,ring,sector,strip);
writer->AddSignal(digit->Count1());
if (sampleRate >= 2) writer->AddSignal(digit->Count2());
if (sampleRate >= 3) writer->AddSignal(digit->Count3());
delete file;
}
}
-
-
-
-#if 0
-//____________________________________________________________________
-void
-AliFMDRawWriter::WriteDigits(TClonesArray* digits)
-{
- Int_t nDigits = digits->GetEntries();
- if (nDigits < 1) return;
-
- AliFMDParameters* pars = AliFMDParameters::Instance();
- UShort_t prevDetector = 0;
- Char_t prevRing = '\0';
- UShort_t prevSector = 0;
- // UShort_t prevStrip = 0;
-
- // The first seen strip number for a channel
- UShort_t startStrip = 0;
-
- // Which channel number in the ALTRO channel we're at
- UShort_t offset = 0;
-
- // How many times the ALTRO Samples one VA1_ALICE channel
- Int_t sampleRate = 1;
-
- // A buffer to hold 1 ALTRO channel - Normally, one ALTRO channel
- // holds 128 VA1_ALICE channels, sampled at a rate of `sampleRate'
- TArrayI channel(fChannelsPerAltro * sampleRate);
-
- // The Altro buffer
- AliAltroBuffer* altro = 0;
-
- // Loop over the digits in the event. Note, that we assume the
- // the digits are in order in the branch. If they were not, we'd
- // have to cache all channels before we could write the data to
- // the ALTRO buffer, or we'd have to set up a map of the digits.
- for (Int_t i = 0; i < nDigits; i++) {
- // Get the digit
- AliFMDDigit* digit = static_cast<AliFMDDigit*>(digits->At(i));
-
- UShort_t det = digit->Detector();
- Char_t ring = digit->Ring();
- UShort_t sector = digit->Sector();
- UShort_t strip = digit->Strip();
- fThreshold = pars->GetZeroSuppression(det, ring, sector, strip);
- if (det != prevDetector) {
- AliDebug(15, Form("FMD: New DDL, was %d, now %d",
- AliFMDParameters::kBaseDDL + prevDetector - 1,
- AliFMDParameters::kBaseDDL + det - 1));
- // If an altro exists, delete the object, flushing the data to
- // disk, and closing the file.
- if (altro) {
- // When the first argument is false, we write the real
- // header.
- AliDebug(15, Form("New altro: Write channel at %d Strip: %d "
- "Sector: %d Ring: %d",
- i, startStrip, prevSector, prevRing));
- // TPC to FMD translations
- //
- // TPC FMD
- // ----------+-----------
- // pad | strip
- // row | sector
- // sector | ring
- //
- WriteChannel(altro, startStrip, prevSector, prevRing, channel);
- altro->Flush();
- altro->WriteDataHeader(kFALSE, kFALSE);
- delete altro;
- altro = 0;
- }
- prevDetector = det;
- // Need to open a new DDL!
- Int_t ddlId = AliFMDParameters::kBaseDDL + det - 1;
- TString filename(Form("%s_%d.ddl", fFMD->GetName(), ddlId));
-
- AliDebug(15, Form("New altro buffer with DDL file %s",
- filename.Data()));
- AliDebug(15, Form("New altro at %d", i));
- // Create a new altro buffer - a `1' as the second argument
- // means `write mode'
- altro = new AliAltroBuffer(filename.Data(), 1);
- altro->SetMapping(pars->GetAltroMap());
-
- // Write a dummy (first argument is true) header to the DDL
- // file - later on, when we close the file, we write the real
- // header
- altro->WriteDataHeader(kTRUE, kFALSE);
-
- // Figure out the sample rate
- if (fSampleRate > 0) sampleRate = fSampleRate;
- else {
- if (digit->Count2() >= 0) sampleRate = 2;
- if (digit->Count3() >= 0) sampleRate = 3;
- }
-
- channel.Set(fChannelsPerAltro * sampleRate);
- offset = 0;
- prevRing = ring;
- prevSector = sector;
- startStrip = strip;
- }
- else if (offset == fChannelsPerAltro
- || digit->Ring() != prevRing
- || digit->Sector() != prevSector) {
- // Force a new Altro channel
- AliDebug(15, Form("Flushing channel to disk because %s",
- (offset == fChannelsPerAltro ? "channel is full" :
- (ring != prevRing ? "new ring up" :
- "new sector up"))));
- AliDebug(15, Form("New Channel: Write channel at %d Strip: %d "
- "Sector: %d Ring: %d",
- i, startStrip, prevSector, prevRing));
- WriteChannel(altro, startStrip, prevSector, prevRing, channel);
- // Reset and update channel variables
- channel.Reset(0);
- offset = 0;
- startStrip = strip;
- prevRing = ring;
- prevSector = sector;
- }
-
- // Store the counts of the ADC in the channel buffer
- channel[offset * sampleRate] = digit->Count1();
- if (sampleRate > 1)
- channel[offset * sampleRate + 1] = digit->Count2();
- if (sampleRate > 2)
- channel[offset * sampleRate + 2] = digit->Count3();
- offset++;
- }
- // Finally, we need to close the final ALTRO buffer if it wasn't
- // already
- if (altro) {
- altro->Flush();
- altro->WriteDataHeader(kFALSE, kFALSE);
- delete altro;
- }
-}
-
-//____________________________________________________________________
-void
-AliFMDRawWriter::WriteChannel(AliAltroBuffer* altro,
- UShort_t strip, UShort_t sector, Char_t ring,
- const TArrayI& data)
-{
- // Write out one ALTRO channel to the data file.
- // Derived classes can overload this method to use a per-ALTRO
- // threshold. This implementation uses the common threshold set by
- // SetThreshold.
- altro->WriteChannel(Int_t(strip),
- Int_t(sector),
- Int_t((ring == 'I' ? 0 : 1)),
- data.fN, data.fArray, fThreshold);
-}
#endif
+
//____________________________________________________________________
* See cxx source for full Copyright notice
*/
/* $Id$ */
+/** @file AliFMDRawWriter.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:45:56 2006
+ @brief Class to write raw data
+*/
//____________________________________________________________________
//
// Class to writer ADC values to a Raw File
ALTRO data. */
virtual void WriteDigits(TClonesArray* digits);
protected:
- /* Write a single channel. This member function is obsolete. */
- // virtual void WriteChannel(AliAltroBuffer* altro, UShort_t strip,
- // UShort_t sector, Char_t ring, const TArrayI& d);
AliFMD* fFMD; //! Pointer to detector description
UShort_t fSampleRate; // The sample rate (0 -> inferred from data)
UShort_t fChannelsPerAltro; // Number of pre-amp. channels/adc channel
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDRecPoint.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:46:26 2006
+ @brief Pseudo reconstructed charged particle multiplicity
+*/
//____________________________________________________________________
//
// Base class for reconstructed charged particle multiplicty in the
#ifndef ALIFMDRECPOINT_H
#define ALIFMDRECPOINT_H
-
// Reconstracted Particles Class: has number of reconstructed
// particles in sectors from NumOfMinSector to NumberOfMaxSector()
// rings from NumOfMinRing to NumOfMaxRing for each FMDvolume
//
+/** @file AliFMDRecPoint.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:46:26 2006
+ @brief Pseudo reconstructed charged particle multiplicity
+*/
#ifndef ROOT_TObject
# include <TObject.h>
#endif
-/** Reconstructed FMD points. It contains the pseudo-inclusive
- multiplicity
+/** @brief Reconstructed FMD points.
+ It contains the pseudo-inclusive multiplicity
@ingroup FMD_rec
*/
class AliFMDRecPoint: public TObject
* about the suitability of this software for any purpose. It is *
* 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
+*/
//____________________________________________________________________
//
// This is a class that constructs AliFMDMult (reconstructed
//-- Authors: Evgeny Karpechev (INR) and Alla Maevskaia (INR)
// Latest changes by Christian Holm Christensen <cholm@nbi.dk>
/* $Id$ */
+/** @file AliFMDReconstructor.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:47:09 2006
+ @brief FMD reconstruction
+*/
//____________________________________________________________________
// Header guards in the header files speeds up the compilation
/** @defgroup FMD_rec Reconstruction */
//____________________________________________________________________
-/** This is a class that reconstructs AliFMDRecPoint objects from of
- Digits. This class reads either digits from a TClonesArray or raw
- data from a DDL file (or similar), and applies calibrations to get
+/** @brief This is a class that reconstructs AliFMDRecPoint objects from of
+ Digits.
+ This class reads either digits from a TClonesArray or raw data
+ from a DDL file (or similar), and applies calibrations to get
psuedo-inclusive multiplicities per strip.
+
@ingroup FMD_rec
*/
class AliFMDReconstructor: public AliReconstructor
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDRing.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:47:43 2006
+ @brief FMD ring geometry parameters
+*/
//__________________________________________________________________
//
// Utility class to help implement collection of FMD modules into
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDRing.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:47:43 2006
+ @brief FMD ring geometry parameters
+*/
//__________________________________________________________________
//
// Parameters of the FMD rings.
class TBrowser;
class TVector2;
-/** Geometry description and parameters of a ring in the FMD
+/** @brief Geometry description and parameters of a ring in the FMD
detector.
As there are only 2 kinds of rings @e Inner (@c 'I') and @e
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDUShortMap.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:48:18 2006
+ @brief Per strip of unisgned shorts (16 bit) data
+*/
//____________________________________________________________________
//
// A map of per strip UShort_t information (for example ADC values,
*
* See cxx source for full Copyright notice
*/
+/** @file AliFMDUShortMap.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:48:18 2006
+ @brief Per strip of unisgned shorts (16 bit) data
+*/
#ifndef ALIFMDMAP_H
# include "AliFMDMap.h"
#endif
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDv0.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:48:51 2006
+ @brief Concrete implementation of FMD detector driver - coarse
+ version
+*/
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers. This class
*
* See cxx source for full Copyright notice
*/
-
+/** @file AliFMDv0.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:48:51 2006
+ @brief Concrete implementation of FMD detector driver - coarse
+ version
+*/
//____________________________________________________________________
//
// Manager class for the FMD - Coarse version.
#endif
//____________________________________________________________________
-/** Forward Multiplicity Detector based on Silicon wafers. This class
- contains the base procedures for the Forward Multiplicity detector
- Detector consists of 3 sub-detectors FMD1, FMD2, and FMD3, each of
- which has 1 or 2 rings of silicon sensors.
+/** @brief Forward Multiplicity Detector based on Silicon wafers.
+
+ This class contains the base procedures for the Forward
+ Multiplicity detector Detector consists of 3 sub-detectors FMD1,
+ FMD2, and FMD3, each of which has 1 or 2 rings of silicon sensors.
This contains the coarse version of the FMD - that is, the
simulation produces no hits in the FMD volumes, and the sensors
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
+/** @file AliFMDv1.cxx
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:48:51 2006
+ @brief Concrete implementation of FMD detector driver - detailed
+ version
+*/
//____________________________________________________________________
//
// Forward Multiplicity Detector based on Silicon wafers. This class
*
* See cxx source for full Copyright notice
*/
-
+/** @file AliFMDv1.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:48:51 2006
+ @brief Concrete implementation of FMD detector driver - detailed
+ version
+*/
//____________________________________________________________________
//
// Manager class for the FMD - Detailed version.
#endif
//____________________________________________________________________
-/** Forward Multiplicity Detector based on Silicon wafers. This class
- contains the base procedures for the Forward Multiplicity detector
- Detector consists of 3 sub-detectors FMD1, FMD2, and FMD3, each of
- which has 1 or 2 rings of silicon sensors.
+/** @brief Forward Multiplicity Detector based on Silicon wafers.
+
+ This class contains the base procedures for the Forward
+ Multiplicity detector Detector consists of 3 sub-detectors FMD1,
+ FMD2, and FMD3, each of which has 1 or 2 rings of silicon sensors.
This class contains the detailed version of the FMD - that is,
hits are produced during simulation.
// -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
// root [0] .x grun.C(1,"ConfigPPR.C++")
//
+/** @file Config.C
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 12:50:29 2006
+ @brief Simulation configuration script
+*/
#if !defined(__CINT__) || defined(__MAKECINT__)
#include <Riostream.h>
#include <TRandom.h>
EXAMPLE_PATH = /home/hehi/cholm/work/alice/aliroot/FMD/scripts/
EXAMPLE_PATTERNS = *.C
EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
+IMAGE_PATH = /home/hehi/cholm/work/alice/aliroot/FMD/pics/
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
+/** @file DrawFMD.C
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 14:18:21 2006
+ @brief Script to draw the FMD3 - obsolete
+*/
void DrawFMD()
{
// gSystem->Load("/usr/lib/libshift");
* See cxx source for full Copyright notice */
/* $Id$ */
-
+/** @file FMDbaseLinkDef.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 14:18:46 2006
+ @brief Link specifications for base library
+*/
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class AliFMDCalibPedestal+;
#pragma link C++ class AliFMDCalibGain+;
#pragma link C++ class AliFMDCalibSampleRate+;
+#pragma link C++ class AliFMDCalibStripRange+;
#pragma link C++ class AliFMDAltroMapping+;
-#pragma link C++ class AliFMDAltroIO+;
-#pragma link C++ class AliFMDAltroReader+;
-#pragma link C++ class AliFMDAltroWriter+;
+// #pragma link C++ class AliFMDAltroIO+;
+// #pragma link C++ class AliFMDAltroReader+;
+// #pragma link C++ class AliFMDAltroWriter+;
#else
# error Not for compilation
* See cxx source for full Copyright notice
*/
/* $Id$ */
+/** @file FMDrecLinkDef.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 14:19:08 2006
+ @brief Link specifications for reconstruction library
+
+*/
#ifdef __CINT__
#pragma link off all globals;
*
* See cxx source for full Copyright notice
*/
-
+/** @file FMDsimLinkDef.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 14:19:24 2006
+ @brief Link specifications fo simulation library
+*/
/* $Id$ */
#ifdef __CINT__
*
* See cxx source for full Copyright notice
*/
-
+/** @file FMDutilLinkDef.h
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 14:19:41 2006
+ @brief Link specification for utility libary
+*/
/* $Id$ */
#ifdef __CINT__
**************************************************************************/
/* $Id$ */
-
+/** @file Reconstruct.C
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 14:19:56 2006
+ @brief Script to do reconstruction
+*/
// Script to do test the FMD digitization class.
+/** Do reconstruction */
void
Reconstruct()
{
AliCDBManager* cdb = AliCDBManager::Instance();
- cdb->SetDefaultStorage("local://cdb");
+ cdb->SetDefaultStorage("local://$ALICE_ROOT");
AliLog::SetModuleDebugLevel("FMD", 2);
AliReconstruction rec;
rec.SetRunLocalReconstruction("FMD");
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
/* $Id$ */
-
-// Script to do test the FMD digitization class.
+/** @file Simulate.C
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 14:20:24 2006
+ @brief Script to do simulation
+*/
+/** Script to do test the FMD digitization class.
+ */
void
Simulate()
{
AliCDBManager* cdb = AliCDBManager::Instance();
- cdb->SetDefaultStorage("local://cdb");
+ cdb->SetDefaultStorage("local://$ALICE_ROOT");
AliSimulation sim;
AliCDBEntry* align = cdb->Get("FMD/Align/Data");
if (align) {
+/** @file ViewFMD.C
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Mon Mar 27 14:20:48 2006
+ @brief Script to setup FMD volumes for viewing - obsolete
+*/
+/** Setup FMD volumes for viewing - obsolete */
void ViewFMD()
{
gMC->Gsatt("FMD1","seen",0);
AliFMDCalibPedestal.cxx \
AliFMDCalibGain.cxx \
AliFMDCalibSampleRate.cxx \
+ AliFMDCalibStripRange.cxx \
AliFMDAltroMapping.cxx \
- AliFMDAltroIO.cxx \
AliFMDParameters.cxx \
AliFMDGeometry.cxx \
AliFMDRing.cxx \
AliFMD2.cxx \
AliFMD3.cxx
+# AliFMDAltroIO.cxx
+
HDRS = $(SRCS:.cxx=.h)
DHDR := FMDbaseLinkDef.h
if (!TGeoManager::Import("geometry.root"))
gAlice->Init("$ALICE_ROOT/FMD/Config.C");
AliCDBManager* cdb = AliCDBManager::Instance();
- cdb->SetDefaultStorage("local://cdb");
-
+ cdb->SetDefaultStorage("local://$ALICE_ROOT");
+
gSystem->Load("libFMDutil.so");
- AliFMDAlignFaker f;
- f.RemoveAlign(AliFMDAlignFaker::kHalves);
+ AliFMDAlignFaker f(AliFMDAlignFaker::kAll, "geometry.root", 0);
+ // f.RemoveAlign(AliFMDAlignFaker::kHalves);
f.SetSensorDisplacement(0, 0, 0, 0, 0, 0);
- f.SetSensorRotation(0, 0, 0, 3, 3, 3);
+ f.SetSensorRotation(0, 0, 0, 0, 0, 0);
+ f.SetHalfDisplacement(0, 0, 0, 0, 0, 0);
+ f.SetHalfRotation(0, 0, 0, 0, 0, 0);
f.Exec();
}
//____________________________________________________________________
--- /dev/null
+//____________________________________________________________________
+//
+// $Id$
+//
+// Make fake alignment data.
+//
+/** @file MakeCalibration.C
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Sun Mar 26 17:58:27 2006
+ @brief Make fake calibration data.
+*/
+/** Make fake calibration data
+ @ingroup simple_script
+ */
+void
+MakeCalibration()
+{
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ cdb->SetDefaultStorage("local://$ALICE_ROOT");
+
+ gSystem->Load("libFMDutil.so");
+ AliFMDCalibFaker f(AliFMDCalibFaker::kAll, 0);
+ f.SetGainSeed(30);
+ f.SetThresholdFactor(3);
+ f.SetPedestalRange(20,40);
+ f.SetDeadChance(0);
+ f.SetZeroThreshold(0);
+ f.SetStripRange(0, 127);
+ f.SetRate(1);
+ f.Exec();
+}
+//____________________________________________________________________
+//
+// EOF
+//
#include <TH2D.h>
#include <TStyle.h>
#include <TArrayF.h>
+#include <TCanvas.h>
+#include <TStyle.h>
+#include <TROOT.h>
+#include <TFile.h>
#include <iostream>
/** @class Poisson
*/
class Poisson : public AliFMDInput
{
-private:
+protected:
TH2D* fEmpty; // Histogram
TH2D* fTotal; // Histogram
TH2D* fMult; // Histogram
TFile* fFile; // File
Int_t fEv; // Event number
+ Double_t fThreshold;
public:
+ /** Constructor
+ @param threshold Threshold
+ @param nEta # of @f$ \eta@f$ bins
+ @param minEta minimum @f$ \eta@f$
+ @param maxEta maximum @f$ \eta@f$
+ @param nPhi # of @f$ \eta@f$ bins
+ @param minPhi minimum @f$ \varphi@f$
+ @param maxPhi maximum @f$ \varphi@f$ */
Poisson(Double_t threshold=.3,
Int_t nEta=120, Float_t minEta=-6, Float_t maxEta=6,
Int_t nPhi=4, Float_t minPhi=0, Float_t maxPhi=2*TMath::Pi())
- : fFile(0), fEv(0)
+ : fFile(0), fEv(0), fThreshold(threshold)
{
AddLoad(kESD);
fMult->SetZTitle("<M_{ch}>");
}
- Bool_t Init()
+ /** Initialize the analyser. Opens the output file.
+ @return @c true on success. */
+ virtual Bool_t Init()
{
- if (!AliFMDInput::Begin(event)) return kFALSE;
- fFile = TFile::Open("poisson.root");
+ if (!AliFMDInput::Init()) return kFALSE;
+ fFile = TFile::Open("poisson.root", "RECREATE");
if (!fFile) return kFALSE;
return kTRUE;
}
/** Begining of event
@param event Event number
@return @c false on error */
- Bool_t Begin(Int_t event)
+ virtual Bool_t Begin(Int_t event)
{
if (!AliFMDInput::Begin(event)) return kFALSE;
fEv = event;
fMult->Clear();
return kTRUE;
}
- Bool_t ProcessESD(AliESDFMDHit* esd)
+ /** Process ESD data. For each strip, check if the
+ psuedo-multiplicity is less than the threshold. If it is, then
+ count the strip as empty.
+ @param esd ESD data
+ @return @c true on success. */
+ virtual Bool_t ProcessESD(AliESDFMD* esd)
{
- for (UShort_t det = 1; det <= esd->MaxDetector(); det++) {
- for (UShort_t rng = 0; rng < esd->MaxRing(); rng++) {
+ for (UShort_t det = 1; det <= 3; det++) {
+ for (UShort_t rng = 0; rng < 2; rng++) {
Char_t ring = (rng == 0 ? 'I' : 'O');
// Not covered channels
- for (UShort_t sec = 0; sec < esd->MaxSector(); sec++) {
- for (UShort_t str = 0; str < esd->MaxStrip(); str++) {
+ for (UShort_t sec = 0; sec < 40; sec++) {
+ for (UShort_t str = 0; str < 512; str++) {
Float_t mult = esd->Multiplicity(det, ring, sec, str);
Float_t eta = esd->Eta(det, ring, sec, str);
// Dead channels, or not covered.
if (mult >= AliESDFMD::kInvalidMult) continue;
- if (esd >= AliESDFMD::kInvalidEta) continue;
+ if (eta >= AliESDFMD::kInvalidEta) continue;
Float_t phi;
switch (ring) {
case 'I': phi = (sec + .5) * 2 * TMath::Pi() / 20; break;
case 'O': phi = (sec + .5) * 2 * TMath::Pi() / 40; break;
}
fTotal->Fill(eta, phi);
- if (mult < threshold) fEmpty->Fill(eta, phi);
+ if (mult < fThreshold) fEmpty->Fill(eta, phi);
} // Loop over strips
} // Loop over sectors
} // Loop over rings
} // Loop over detectors
+ return kTRUE;
}
/** For each bin, reconstruct the charge particle multiplicity as
@f[
and @f$ N_{empty}@f$ is the number of strips in the bin that did
not fire.
@return @c true */
- Bool_t End()
+ virtual Bool_t End()
{
for (Int_t etaBin = 1; etaBin <= fEmpty->GetNbinsX(); etaBin++) {
for (Int_t phiBin = 1; phiBin <= fEmpty->GetNbinsY(); phiBin++) {
Double_t empty = fEmpty->GetBinContent(etaBin, phiBin);
Double_t total = fTotal->GetBinContent(etaBin, phiBin);
- Double_t lambda = (empty > 0 ? - TMath::Log(empty / nTotal) : 1);
- Double_t mult = lambda * nTotal;
+ Double_t lambda = (empty > 0 ? - TMath::Log(empty / total) : 1);
+ Double_t mult = lambda * total;
fMult->SetBinContent(etaBin, phiBin, mult);
}
}
fFile->cd();
fMult->Write(Form("mult%03d", fEv));
+ if (!gROOT->IsBatch()) {
+ gStyle->SetPalette(1);
+ TCanvas* c = new TCanvas("poisson", "Poisson multiplicity");
+ c->SetFillColor(0);
+ fMult->Draw("colz");
+ }
return AliFMDInput::End();
}
- Bool_t Finish()
+ /** At end of run. Write and close output file @c poisson.root
+ @return @c true on success */
+ virtual Bool_t Finish()
{
fFile->Write();
fFile->Close();
--- /dev/null
+//____________________________________________________________________
+//
+// $Id$
+//
+// Script that contains a class to draw hits, using the
+// AliFMDInputHits class in the util library.
+//
+// It draws the energy loss versus the p/(mq^2). It can be overlayed
+// with the Bethe-Bloc curve to show how the simulation behaves
+// relative to the expected.
+//
+// Use the script `Compile.C' to compile this class using ACLic.
+//
+#include "Poisson.C"
+#include <TMath.h>
+#include <TCanvas.h>
+#include <AliFMDHit.h>
+#include <AliFMDGeometry.h>
+
+/** @class PoissonHit
+ @brief Make a poisson reconstruction and compare to simulated hits
+ @code
+ Root> .L Compile.C
+ Root> Compile("Poisson.C")
+ Root> Compile("PoissonHit.C")
+ Root> PoissonHit c
+ Root> c.Run();
+ @endcode
+ @ingroup FMD_script
+ */
+class PoissonHit : public Poisson
+{
+protected:
+ TH2D* fHits; // Histogram
+ TH2D* fDiff; // Histogram
+public:
+ /** Constructor
+ @param threshold Threshold
+ @param nEta # of @f$ \eta@f$ bins
+ @param minEta minimum @f$ \eta@f$
+ @param maxEta maximum @f$ \eta@f$
+ @param nPhi # of @f$ \eta@f$ bins
+ @param minPhi minimum @f$ \varphi@f$
+ @param maxPhi maximum @f$ \varphi@f$ */
+ PoissonHit(Double_t threshold=.3,
+ Int_t nEta=120, Float_t minEta=-6, Float_t maxEta=6,
+ Int_t nPhi=4, Float_t minPhi=0, Float_t maxPhi=2*TMath::Pi())
+ : Poisson(threshold, nEta, minEta, maxEta, nPhi, minPhi, maxPhi)
+ {
+ AddLoad(kHits);
+ AddLoad(kGeometry);
+ fHits = new TH2D(*fEmpty);
+ fHits->SetName("hits");
+ fHits->SetTitle("# of hits");
+ fDiff = new TH2D(*fEmpty);
+ fDiff->SetName("diff");
+ fDiff->SetTitle("Difference between poisson and hits");
+ fHits->SetXTitle("#eta");
+ fHits->SetYTitle("#phi");
+ fHits->SetZTitle("N");
+ fDiff->SetXTitle("#eta");
+ fDiff->SetYTitle("#phi");
+ fDiff->SetZTitle("#frac{N_{hit}-N_{poisson}}{N_{hit}}");
+ }
+ /** Initialize the analyser. Opens the output file.
+ @return @c true on success. */
+ virtual Bool_t Init()
+ {
+ if (!Poisson::Init()) return kFALSE;
+ AliFMDGeometry::Instance()->Init();
+ AliFMDGeometry::Instance()->InitTransformations();
+ return kTRUE;
+ }
+ /** Get the @f$ \eta@f$ and @f$\varphi@f$ corresponding to the
+ spatial coordinates @f$ \mathbf{v} = (x,y,z)@f$
+ @param x X coordinate
+ @param y Y coordinate
+ @param z Z coordinate
+ @param eta Psuedo rapidity @f$ \eta@f$
+ @param phi Azimuthal angle @f$\varphi@f$
+ */
+ void PhysicalCoordinates(Double_t x, Double_t y, Double_t z,
+ Double_t& eta, Double_t& phi)
+ {
+ Double_t r, theta;
+ phi = TMath::ATan2(y, x);
+ r = TMath::Sqrt(y * y + x * x);
+ theta = TMath::ATan2(r, z);
+ eta = -TMath::Log(TMath::Tan(theta / 2));
+ if (phi < 0) phi += 2 * TMath::Pi();
+ }
+ /** Process one hit. Increment bin corresponding to strip.
+ @param hit Hit.
+ @return @c true on success */
+ virtual Bool_t ProcessHit(AliFMDHit* hit, TParticle*)
+ {
+ Double_t x, y, z;
+#if 0
+ AliFMDGeometry* geom = AliFMDGeometry::Instance();
+ geom->Detector2XYZ(hit->Detector(),hit->Ring(),hit->Sector(),
+ hit->Strip(),x,y,z);
+#else
+ x = hit->X();
+ y = hit->Y();
+ z = hit->Z();
+#endif
+ Double_t eta, phi;
+ PhysicalCoordinates(x, y, z, eta, phi);
+ fHits->Fill(eta, phi);
+ return kTRUE;
+ }
+ /** Begining of event
+ @param event Event number
+ @return @c false on error */
+ virtual Bool_t Begin(Int_t event)
+ {
+ if (!Poisson::Begin(event)) return kFALSE;
+ fHits->Clear();
+ fDiff->Clear();
+ return kTRUE;
+ }
+ /** Let the poisson code do it's job, and then compare to the
+ numberr of hits.
+ @return @c true */
+ virtual Bool_t End()
+ {
+ if (!Poisson::End()) return kFALSE;
+ fDiff->Add(fMult,fHits,-1.,1.);
+ fDiff->Divide(fHits);
+ if (!gROOT->IsBatch()) {
+ gStyle->SetPalette(1);
+ TCanvas* c1 = new TCanvas("hits", "Hit multiplicity");
+ c1->SetFillColor(0);
+ fHits->Draw("colz");
+ TCanvas* c2 = new TCanvas("diff", "Difference between Hit and poisson");
+ c2->SetFillColor(0);
+ fDiff->Draw("colz");
+ TCanvas* c3 = new TCanvas("empty", "# of Empty strips");
+ c3->SetFillColor(0);
+ fEmpty->Draw("colz");
+ TCanvas* c4 = new TCanvas("total", "Total # of strips");
+ c4->SetFillColor(0);
+ fTotal->Draw("colz");
+ }
+ return kTRUE;
+ }
+
+ ClassDef(PoissonHit,0);
+};
+
+//____________________________________________________________________
+//
+// EOF
+//
--- /dev/null
+//____________________________________________________________________
+//
+// $Id$
+//
+// Read in the geometry, and get alignment data from CDB, and apply
+// that to the geometry.
+//
+/** Print alignment to a geometry
+ @ingroup simple_script
+ */
+#include <iomanip>
+void
+PrintAlignment()
+{
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ AliCDBEntry* align = cdb->Get("FMD/Align/Data");
+ if (!align) {
+ Error("PrintAlignment","didn't alignment data from CDB");
+ return;
+ }
+
+ TClonesArray* array = dynamic_cast<TClonesArray*>(align->GetObject());
+ if (!array) {
+ Warning("PrintAlignement", "Invalid align data from CDB");
+ return;
+ }
+ Int_t nAlign = array->GetEntries();
+ for (Int_t i = 0; i < nAlign; i++) {
+ AliAlignObjAngles* a = static_cast<AliAlignObjAngles*>(array->At(i));
+ Double_t ang[3];
+ Double_t trans[3];
+ a->GetAngles(ang);
+ a->GetTranslation(trans);
+ std::cout << a->GetVolPath() << "\n"
+ << " translation: "
+ << "(" << std::setw(12) << trans[0]
+ << "," << std::setw(12) << trans[1]
+ << "," << std::setw(12) << trans[2] << ")\n"
+ << " rotation: "
+ << "(" << std::setw(12) << ang[0]
+ << "," << std::setw(12) << ang[1]
+ << "," << std::setw(12) << ang[2] << ")" << std::endl;
+ // a->Print();
+ }
+}
+//____________________________________________________________________
+//
+// EOF
+//
--- /dev/null
+/** @file ReadRaw.C
+ @author Christian Holm Christensen <cholm@nbi.dk>
+ @date Tue Mar 28 12:39:08 2006
+ @brief Script to read raw data
+*/
+/** @ingroup FMD_script
+ @brief Read raw data into a TClonesArray - for testing
+ */
+void
+ReadRaw()
+{
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ AliLog::SetModuleDebugLevel("FMD", 10);
+ AliFMDParameters::Instance()->Init();
+ AliRawReader* r = new AliRawReaderFile(0);
+ AliFMDRawReader* fr = new AliFMDRawReader(r, 0);
+ TClonesArray* a = new TClonesArray("AliFMDDigit");
+ fr->ReadAdcs(a);
+}
+//____________________________________________________________________
+//
+// EOF
+//