--- /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$ */
+
+//____________________________________________________________________
+//
+// Forward Multiplicity Detector based on Silicon wafers.
+//
+// This task creates fake alignrations. Which alignration, depends on
+// the bit mask passed to the constructor, or added by `AddAlign'.
+//
+// The default is to write all alignration parameters to a local
+// storage `local://cdb' which is a directory in the current
+// directory.
+//
+#include "AliLog.h" // ALILOG_H
+#include "AliFMDAlignFaker.h" // ALIFMDALIGNFAKER_H
+#include <AliCDBManager.h> // ALICDBMANAGER_H
+#include <AliCDBEntry.h> // ALICDBMANAGER_H
+#include <AliAlignObj.h>
+#include <AliAlignObjAngles.h>
+#include <Riostream.h>
+#include <TSystem.h>
+#include <TMath.h>
+#include <TRandom.h>
+#include <TClonesArray.h>
+#include <TString.h>
+#include <TFile.h>
+#include <TGeoManager.h>
+#include <TGeoNode.h>
+#include <TGeoVolume.h>
+
+//====================================================================
+ClassImp(AliFMDAlignFaker)
+#if 0
+ ; // This is here to keep Emacs for indenting the next line
+#endif
+
+//____________________________________________________________________
+AliFMDAlignFaker::AliFMDAlignFaker(Int_t mask, const char* geo,
+ const char* loc)
+ : TTask(geo, loc),
+ fMask(mask),
+ fRunMin(0),
+ fRunMax(10),
+ fArray(0)
+{
+ // Default constructor
+ SetSensorDisplacement();
+ SetSensorRotation();
+ SetHalfDisplacement();
+ SetHalfRotation();
+}
+
+//__________________________________________________________________
+void
+AliFMDAlignFaker::SetSensorDisplacement(Double_t x1, Double_t y1, Double_t z1,
+ Double_t x2, Double_t y2, Double_t z2)
+{
+ // Set sensor displacement (unit is centimeters)
+ fSensorTransMin.SetXYZ(x1, y1, z1);
+ fSensorTransMax.SetXYZ(x2, y2, z2);
+}
+
+//__________________________________________________________________
+void
+AliFMDAlignFaker::SetSensorRotation(Double_t x1, Double_t y1, Double_t z1,
+ Double_t x2, Double_t y2, Double_t z2)
+{
+ // Set sensor rotations (unit is degrees)
+ fSensorRotMin.SetXYZ(x1, y1, z1);
+ fSensorRotMax.SetXYZ(x2, y2, z2);
+}
+
+//__________________________________________________________________
+void
+AliFMDAlignFaker::SetHalfDisplacement(Double_t x1, Double_t y1, Double_t z1,
+ Double_t x2, Double_t y2, Double_t z2)
+{
+ // Set half ring/cone displacement (unit is centimeters)
+ fHalfTransMin.SetXYZ(x1, y1, z1);
+ fHalfTransMax.SetXYZ(x2, y2, z2);
+}
+
+//__________________________________________________________________
+void
+AliFMDAlignFaker::SetHalfRotation(Double_t x1, Double_t y1, Double_t z1,
+ Double_t x2, Double_t y2, Double_t z2)
+{
+ // Set half ring/cone rotations (unit is degrees)
+ fHalfRotMin.SetXYZ(x1, y1, z1);
+ fHalfRotMax.SetXYZ(x2, y2, z2);
+}
+
+//__________________________________________________________________
+#define IS_NODE_HALF(name) \
+ (name[0] == 'F' && name[2] == 'M' && (name[3] == 'T' || name[3] == 'B'))
+#define IS_NODE_SENSOR(name) \
+ (name[0] == 'F' && name[2] == 'S' && name[3] == 'E')
+
+//__________________________________________________________________
+void
+AliFMDAlignFaker::Exec(Option_t*)
+{
+ // Make the objects.
+
+ // Get geometry
+ if (!gGeoManager) {
+ if (!TGeoManager::Import(GetName())) {
+ AliFatal(Form("Failed to import geometry from %s", GetName()));
+ return;
+ }
+ }
+ // Get top volume
+ TGeoVolume* topVolume = gGeoManager->GetTopVolume();
+ if (!topVolume) {
+ AliFatal("No top-level volume defined");
+ return;
+ }
+ // Make container of transforms
+ if (!fArray) fArray = new TClonesArray("AliAlignObjAngles");
+ fArray->Clear();
+
+ // Make an iterator
+ TGeoIterator next(topVolume);
+ TGeoNode* node = 0;
+
+ // Loop over all entries in geometry to find our nodes.
+ while ((node = static_cast<TGeoNode*>(next()))) {
+ const char* name = node->GetName();
+ if (IS_NODE_HALF(name) && TESTBIT(fMask, kHalves) ||
+ IS_NODE_SENSOR(name) && TESTBIT(fMask, kSensors)) {
+ // Get the path
+ TString path(Form("/%s", gGeoManager->GetNode(0)->GetName()));
+ Int_t nLevel = next.GetLevel();
+ for (Int_t lvl = 0; lvl <= nLevel; lvl++) {
+ TGeoNode* p = next.GetNode(lvl);
+ if (!p && lvl != 0) {
+ AliWarning(Form("No node at level %d in path %s", lvl, path.Data()));
+ continue;
+ }
+ if (!path.IsNull()) path.Append("/");
+ path.Append(p->GetName());
+ }
+ Int_t id = node->GetVolume()->GetNumber();
+ if (IS_NODE_HALF(name)) MakeAlignHalf(path, id);
+ if (IS_NODE_SENSOR(name)) MakeAlignSensor(path, id);
+ }
+ }
+
+ TString t(GetTitle());
+ if (t.Contains("local://") || t.Contains("alien://"))
+ WriteToCDB();
+ else
+ WriteToFile();
+}
+
+//__________________________________________________________________
+Bool_t
+AliFMDAlignFaker::MakeAlign(const TString& path, Int_t id,
+ Double_t transX, Double_t transY, Double_t transZ,
+ Double_t rotX, Double_t rotY, Double_t rotZ)
+{
+ AliDebug(1, Form("Make alignment for %s (volume %d)", path.Data(), id));
+ Int_t nAlign = fArray->GetEntries();
+ AliAlignObjAngles* obj =
+ new ((*fArray)[nAlign]) AliAlignObjAngles(path.Data(), id,0,0,0,0,0,0);
+ if (!obj) {
+ AliError(Form("Failed to create alignment object for %s", path.Data()));
+ return kFALSE;
+ }
+ if (!obj->SetLocalPars(transX, transY, transZ, rotX, rotY, rotZ)) {
+ AliError(Form("Failed to set local transforms on %s", path.Data()));
+ return kTRUE;
+ }
+ return kTRUE;
+}
+
+//__________________________________________________________________
+Bool_t
+AliFMDAlignFaker::MakeAlignHalf(const TString& path, Int_t id)
+{
+ AliDebug(1, Form("Make alignment for half-ring/cone %s", path.Data()));
+ Double_t transX = gRandom->Uniform(fHalfTransMin.X(), fHalfTransMax.X());
+ Double_t transY = gRandom->Uniform(fHalfTransMin.Y(), fHalfTransMax.Y());
+ Double_t transZ = gRandom->Uniform(fHalfTransMin.Z(), fHalfTransMax.Z());
+ Double_t rotX = gRandom->Uniform(fHalfRotMin.X(), fHalfRotMax.X());
+ Double_t rotY = gRandom->Uniform(fHalfRotMin.Y(), fHalfRotMax.Y());
+ Double_t rotZ = gRandom->Uniform(fHalfRotMin.Z(), fHalfRotMax.Z());
+ return MakeAlign(path, id, transX, transY, transZ, rotX, rotY, rotZ);
+}
+
+
+//__________________________________________________________________
+Bool_t
+AliFMDAlignFaker::MakeAlignSensor(const TString& path, Int_t id)
+{
+ AliDebug(1, Form("Make alignment for sensor %s", path.Data()));
+ Double_t transX = gRandom->Uniform(fSensorTransMin.X(), fSensorTransMax.X());
+ Double_t transY = gRandom->Uniform(fSensorTransMin.Y(), fSensorTransMax.Y());
+ Double_t transZ = gRandom->Uniform(fSensorTransMin.Z(), fSensorTransMax.Z());
+ Double_t rotX = gRandom->Uniform(fSensorRotMin.X(), fSensorRotMax.X());
+ Double_t rotY = gRandom->Uniform(fSensorRotMin.Y(), fSensorRotMax.Y());
+ Double_t rotZ = gRandom->Uniform(fSensorRotMin.Z(), fSensorRotMax.Z());
+ return MakeAlign(path, id, transX, transY, transZ, rotX, rotY, rotZ);
+}
+
+//__________________________________________________________________
+void
+AliFMDAlignFaker::WriteToCDB()
+{
+ // Make the objects.
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ if (GetTitle()) cdb->SetDefaultStorage(GetTitle());
+
+ AliCDBMetaData* meta = new AliCDBMetaData;
+ meta->SetResponsible(gSystem->GetUserInfo()->fRealName.Data());
+ meta->SetAliRootVersion(gROOT->GetVersion());
+ meta->SetBeamPeriod(1);
+ meta->SetComment("Dummy data for testing");
+
+ AliCDBId id("FMD/Align/Data", fRunMin, fRunMax);
+ cdb->Put(fArray, id, meta);
+ cdb->Destroy();
+}
+
+//__________________________________________________________________
+void
+AliFMDAlignFaker::WriteToFile()
+{
+ TFile* file = TFile::Open(GetTitle(), "RECREATE");
+ if (!file) {
+ AliFatal(Form("Failed to open file '%s' for output", GetTitle()));
+ return;
+ }
+ file->cd();
+ fArray->Write("FMDAlignment");
+ file->Close();
+ file->Write();
+}
+
+
+
+//____________________________________________________________________
+//
+// EOF
+//
--- /dev/null
+#ifndef ALIFMDALIGNFAKER_H
+#define ALIFMDALIGNFAKER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved.
+ *
+ * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
+ *
+ * See cxx source for full Copyright notice
+ */
+
+//____________________________________________________________________
+//
+// Class to make fake alignration parameters
+//
+#ifndef ROOT_TTask
+# include <TTask.h>
+#endif
+#ifndef ROOT_TVector3
+# include <TVector3.h>
+#endif
+class TClonesArray;
+class TString;
+
+class AliFMDAlignFaker : public TTask
+{
+public:
+ enum EWhat {
+ kSensors = 1,
+ kHalves,
+ };
+ enum {
+ kAll = (1<<kHalves|1<<kSensors)
+ };
+ AliFMDAlignFaker(Int_t mask=kAll,
+ const char* geo="geometry.root",
+ const char* loc="local://cdb");
+ virtual ~AliFMDAlignFaker() {}
+ void AddAlign(EWhat w) { SETBIT(fMask, w); }
+ void RemoveAlign(EWhat w) { SETBIT(fMask, w); }
+ void SetAlign(Int_t mask) { fMask = mask; }
+ void SetSensorDisplacement(Double_t x1=0, Double_t y1=0, Double_t z1=0,
+ Double_t x2=.01, Double_t y2=.01, Double_t z2=0);
+ void SetSensorRotation(Double_t x1=0, Double_t y1=0, Double_t z1=0,
+ Double_t x2=.5, Double_t y2=.5, Double_t z2=.5);
+ void SetHalfDisplacement(Double_t x1=0, Double_t y1=0, Double_t z1=0,
+ Double_t x2=.05, Double_t y2=.05, Double_t z2=.05);
+ void SetHalfRotation(Double_t x1=0, Double_t y1=0, Double_t z1=0,
+ Double_t x2=0, Double_t y2=0, Double_t z2=0);
+ void SetOutput(const char* file) { SetTitle(file); }
+ void SetGeometryFile(const char* file) { SetName(file); }
+ void Exec(Option_t* option="");
+protected:
+ Bool_t MakeAlign(const TString& path, Int_t volID,
+ Double_t transX, Double_t transY, Double_t transZ,
+ Double_t rotX, Double_t rotY, Double_t rotZ);
+ Bool_t MakeAlignSensor(const TString& path, Int_t id);
+ Bool_t MakeAlignHalf(const TString& path, Int_t id);
+ void WriteToCDB();
+ void WriteToFile();
+
+ Long_t fMask; // What to write
+ TVector3 fSensorTransMin;
+ TVector3 fSensorTransMax;
+ TVector3 fSensorRotMin;
+ TVector3 fSensorRotMax;
+ TVector3 fHalfTransMin;
+ TVector3 fHalfTransMax;
+ TVector3 fHalfRotMin;
+ TVector3 fHalfRotMax;
+ Int_t fRunMin;
+ Int_t fRunMax;
+ TClonesArray* fArray;
+
+ ClassDef(AliFMDAlignFaker,0)
+};
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+// mode: C++
+// End:
+//
+// EOF
+//
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
+
+//____________________________________________________________________
+//
+// Forward Multiplicity Detector based on Silicon wafers.
+//
+// This task creates fake calibrations. Which calibration, depends on
+// the bit mask passed to the constructor, or added by `AddCalib'.
+//
+// The default is to write all calibration parameters to a local
+// storage `local://cdb' which is a directory in the current
+// directory.
+//
+#include "AliLog.h" // ALILOG_H
+#include "AliFMDCalibFaker.h" // ALIFMDCALIBFAKER_H
+#include "AliFMDCalibGain.h" // ALIFMDCALIBGAIN_H
+#include "AliFMDCalibPedestal.h" // ALIFMDCALIBPEDESTAL_H
+#include "AliFMDCalibSampleRate.h" // ALIFMDCALIBPEDESTAL_H
+#include "AliFMDAltroMapping.h" // ALIFMDALTROMAPPING_H
+#include <AliCDBManager.h> // ALICDBMANAGER_H
+#include <AliCDBEntry.h> // ALICDBMANAGER_H
+#include <Riostream.h>
+#include <TSystem.h>
+#include <TMath.h>
+#include <TRandom.h>
+
+//====================================================================
+ClassImp(AliFMDCalibFaker)
+#if 0
+ ; // This is here to keep Emacs for indenting the next line
+#endif
+
+//____________________________________________________________________
+AliFMDCalibFaker::AliFMDCalibFaker(Int_t mask, const char* loc)
+ : TTask("FMDCalibFaker", loc),
+ fMask(mask),
+ fGain(-1),
+ fThresholdFactor(.1),
+ fThreshold(-1),
+ fPedestalMin(20),
+ fPedestalMax(30),
+ fDeadChance(0),
+ fRate(1),
+ fZeroThreshold(0),
+ fRunMin(0),
+ fRunMax(10)
+{
+ // Default constructor
+}
+
+
+#define MAKE_META(meta) \
+ do { \
+ meta = new AliCDBMetaData; \
+ meta->SetResponsible(gSystem->GetUserInfo()->fRealName.Data()); \
+ meta->SetAliRootVersion(gROOT->GetVersion()); \
+ meta->SetBeamPeriod(1); \
+ meta->SetComment("Dummy data for testing"); } while (false);
+
+
+//__________________________________________________________________
+void
+AliFMDCalibFaker::Exec(Option_t*)
+{
+ // Make the objects.
+ AliCDBManager* cdb = AliCDBManager::Instance();
+ AliFMDParameters* param = AliFMDParameters::Instance();
+ Float_t maxADC = param->GetAltroChannelSize();
+ TObjArray cleanup;
+
+ if (GetTitle()) cdb->SetDefaultStorage(GetTitle());
+
+ AliCDBMetaData* meta = 0;
+ if (TESTBIT(fMask, kPulseGain)) {
+ if (fGain <= 0)
+ fGain = (param->GetVA1MipRange() * param->GetEdepMip() / maxADC);
+ fThreshold = fThresholdFactor * param->GetEdepMip();
+ AliFMDCalibGain* gain = MakePulseGain();
+ AliCDBId id(AliFMDParameters::fgkPulseGain, fRunMin, fRunMax);
+ MAKE_META(meta);
+ meta->SetProperty("key1", gain);
+ cdb->Put(gain, id, meta);
+ cleanup.Add(gain);
+ cleanup.Add(meta);
+ }
+ if (TESTBIT(fMask, kPedestal)) {
+ fPedestalMin = TMath::Max(TMath::Min(fPedestalMin, maxADC), 0.F);
+ fPedestalMax = TMath::Max(TMath::Min(fPedestalMax, maxADC), fPedestalMin);
+ AliFMDCalibPedestal* pedestal = MakePedestal();
+ AliCDBId id(AliFMDParameters::fgkPedestal, fRunMin, fRunMax);
+ MAKE_META(meta);
+ meta->SetProperty("key1", pedestal);
+ cdb->Put(pedestal, id, meta);
+ cleanup.Add(pedestal);
+ cleanup.Add(meta);
+ }
+ if (TESTBIT(fMask, kDeadMap)) {
+ fDeadChance = TMath::Max(TMath::Min(fDeadChance, 1.F), 0.F);
+ AliFMDCalibDeadMap* deadMap = MakeDeadMap();
+ AliCDBId id(AliFMDParameters::fgkDead, fRunMin, fRunMax);
+ MAKE_META(meta);
+ meta->SetProperty("key1", deadMap);
+ cdb->Put(deadMap, id, meta);
+ cleanup.Add(deadMap);
+ cleanup.Add(meta);
+ }
+ if (TESTBIT(fMask, kZeroSuppression)) {
+ fZeroThreshold = TMath::Min(fZeroThreshold, UShort_t(maxADC));
+ AliFMDCalibZeroSuppression* zeroSup = MakeZeroSuppression();
+ AliCDBId id(AliFMDParameters::fgkZeroSuppression,
+ fRunMin, fRunMax);
+ MAKE_META(meta);
+ meta->SetProperty("key1", zeroSup);
+ cdb->Put(zeroSup, id, meta);
+ cleanup.Add(zeroSup);
+ cleanup.Add(meta);
+ }
+ if (TESTBIT(fMask, kSampleRate)) {
+ fRate = TMath::Max(TMath::Min(fRate, UShort_t(8)), UShort_t(1));
+ AliFMDCalibSampleRate* rate = MakeSampleRate();
+ AliCDBId id(AliFMDParameters::fgkSampleRate,fRunMin,fRunMax);
+ MAKE_META(meta);
+ meta->SetProperty("key1", rate);
+ cdb->Put(rate, id, meta);
+ cleanup.Add(rate);
+ cleanup.Add(meta);
+ }
+ if (TESTBIT(fMask, kAltroMap)) {
+ AliFMDAltroMapping* altroMap = MakeAltroMap();
+ AliCDBId id(AliFMDParameters::fgkAltroMap, fRunMin, fRunMax);
+ MAKE_META(meta);
+ meta->SetProperty("key1", altroMap);
+ cdb->Put(altroMap, id, meta);
+ cleanup.Add(altroMap);
+ cleanup.Add(meta);
+ }
+ cdb->Destroy();
+ cleanup.Delete();
+}
+
+
+//__________________________________________________________________
+AliFMDCalibGain*
+AliFMDCalibFaker::MakePulseGain()
+{
+ // Make the actual data
+ AliFMDCalibGain* gain = new AliFMDCalibGain;
+ // Set threshold
+ gain->Set(fThreshold);
+ 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 );
+ UShort_t nStr = ( *ring == 'I' ? 512 : 256 );
+ for (UShort_t sec = 0; sec < nSec; sec++) {
+ for (UShort_t str = 0; str < nStr; str++) {
+ gain->Set(det, *ring, sec, str,
+ gRandom->Gaus(fGain, .01 * fGain));
+ }
+ }
+ }
+ }
+ return gain;
+}
+
+//__________________________________________________________________
+AliFMDCalibPedestal*
+AliFMDCalibFaker::MakePedestal()
+{
+ // Make the actual data
+ AliFMDCalibPedestal* pedestal = new AliFMDCalibPedestal;
+ 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 );
+ UShort_t nStr = ( *ring == 'I' ? 512 : 256 );
+ for (UShort_t sec = 0; sec < nSec; sec++) {
+ for (UShort_t str = 0; str < nStr; str++) {
+ pedestal->Set(det, *ring, sec, str,
+ gRandom->Uniform(fPedestalMin, fPedestalMax), 1.5);
+ }
+ }
+ }
+ }
+ return pedestal;
+}
+
+//__________________________________________________________________
+AliFMDCalibDeadMap*
+AliFMDCalibFaker::MakeDeadMap()
+{
+ // Make the actual data
+ AliFMDCalibDeadMap* deadmap = new AliFMDCalibDeadMap;
+ 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 );
+ UShort_t nStr = ( *ring == 'I' ? 512 : 256 );
+ for (UShort_t sec = 0; sec < nSec; sec++) {
+ for (UShort_t str = 0; str < nStr; str++) {
+ deadmap->operator()(det, *ring, sec, str) =
+ gRandom->Uniform(0, 1) < fDeadChance;
+ }
+ }
+ }
+ }
+ return deadmap;
+}
+
+//__________________________________________________________________
+AliFMDCalibZeroSuppression*
+AliFMDCalibFaker::MakeZeroSuppression()
+{
+ // Make the actual data
+ AliFMDCalibZeroSuppression* zs = new AliFMDCalibZeroSuppression;
+ 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 );
+ UShort_t nStr = ( *ring == 'I' ? 512 : 256 );
+ for (UShort_t sec = 0; sec < nSec; sec++) {
+ for (UShort_t str = 0; str < nStr; str++) {
+ zs->operator()(det, *ring, sec, str) = fZeroThreshold;
+ }
+ }
+ }
+ }
+ return zs;
+}
+
+//__________________________________________________________________
+AliFMDCalibSampleRate*
+AliFMDCalibFaker::MakeSampleRate()
+{
+ AliFMDCalibSampleRate* sampleRate = new AliFMDCalibSampleRate;
+ for (int i = 0; i < 3; i++)
+ sampleRate->Set(AliFMDParameters::kBaseDDL+i, fRate);
+ return sampleRate;
+}
+
+//__________________________________________________________________
+AliFMDAltroMapping*
+AliFMDCalibFaker::MakeAltroMap()
+{
+ AliFMDAltroMapping* m = new AliFMDAltroMapping;
+ return m;
+}
+
+
+
+//____________________________________________________________________
+//
+// EOF
+//
--- /dev/null
+#ifndef ALIFMDCALIBFAKER_H
+#define ALIFMDCALIBFAKER_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
+ * reserved.
+ *
+ * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
+ *
+ * See cxx source for full Copyright notice
+ */
+
+//____________________________________________________________________
+//
+// Class to make fake calibration parameters
+//
+#ifndef ROOT_TTask
+# include <TTask.h>
+#endif
+#include "AliFMDParameters.h" // ALIFMDPARAMETERS_H
+
+class AliFMDCalibFaker : public TTask
+{
+public:
+ enum EWhat {
+ kZeroSuppression = 1,
+ kSampleRate,
+ kPedestal,
+ kPulseGain,
+ kDeadMap,
+ kAltroMap
+ };
+ enum {
+ kAll = (1<<kZeroSuppression|1<<kSampleRate|1<<kPedestal|
+ 1<<kPulseGain|1<<kDeadMap|1<<kAltroMap)
+ };
+ AliFMDCalibFaker(Int_t mask=kAll, const char* loc="local://cdb");
+ virtual ~AliFMDCalibFaker() {}
+ void AddCalib(EWhat w) { SETBIT(fMask, w); }
+ void RemoveCalib(EWhat w) { SETBIT(fMask, w); }
+ void SetCalib(Int_t mask) { fMask = mask; }
+ void SetGainSeed(Float_t g) { fGain = g; }
+ void SetThresholdFactor(Float_t t) { fThresholdFactor = t; }
+ void SetPedestalRange(Float_t min, Float_t max)
+ {
+ fPedestalMin = min;
+ fPedestalMax = (max < min ? min : max);
+ }
+ void SetRunRange(Int_t min, Int_t max)
+ {
+ fRunMin = min;
+ fRunMax = (max < min ? min : max);
+ }
+ void SetDeadChance(Float_t chance) { fDeadChance = chance; }
+ void SetRate(UShort_t rate) { fRate = rate; }
+ void SetZeroThreshold(UShort_t t) { fZeroThreshold = t; }
+ void SetDefaultStorage(const char* url) { SetTitle(url); }
+ void Exec(Option_t* option="");
+protected:
+ virtual AliFMDCalibZeroSuppression* MakeZeroSuppression();
+ virtual AliFMDCalibSampleRate* MakeSampleRate();
+ virtual AliFMDCalibPedestal* MakePedestal();
+ virtual AliFMDCalibGain* MakePulseGain();
+ virtual AliFMDCalibDeadMap* MakeDeadMap();
+ virtual AliFMDAltroMapping* MakeAltroMap();
+
+ Long_t fMask; // What to write
+ Float_t fGain; // Gain
+ Float_t fThresholdFactor; // Threshold factor
+ Float_t fThreshold; // Threshold
+ Float_t fPedestalMin; // Min pedestal
+ Float_t fPedestalMax; // Max pedestal
+ Float_t fDeadChance; // Chance of dead channel
+ UShort_t fRate; // Sample rate
+ UShort_t fZeroThreshold; // Zero suppression threshold
+ Int_t fRunMin;
+ Int_t fRunMax;
+
+ ClassDef(AliFMDCalibFaker,0)
+};
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+// mode: C++
+// End:
+//
+// EOF
+//
+