From a353783892c75e8d215575422d77fdb86f37ef08 Mon Sep 17 00:00:00 2001 From: cholm Date: Thu, 13 Oct 2005 21:39:30 +0000 Subject: [PATCH 1/1] Fixes, and extra debug --- FMD/AliFMD.cxx | 2 + FMD/AliFMDCalibGain.cxx | 70 ++++++++++++++++++++ FMD/AliFMDCalibGain.h | 41 ++++++++++++ FMD/AliFMDCalibPedestal.cxx | 79 ++++++++++++++++++++++ FMD/AliFMDCalibPedestal.h | 41 ++++++++++++ FMD/AliFMDDigitizer.cxx | 2 +- FMD/AliFMDFloatMap.cxx | 128 ++++++++++++++++++++++++++++++++++++ FMD/AliFMDFloatMap.h | 46 +++++++++++++ FMD/AliFMDMultPoisson.cxx | 15 ++++- FMD/AliFMDMultRegion.cxx | 5 +- FMD/AliFMDMultRegion.h | 16 +++-- FMD/AliFMDReconstructor.cxx | 60 ++++++++++++++--- FMD/AliFMDReconstructor.h | 3 + FMD/AliFMDSimulator.cxx | 68 ++++++++++++++++++- FMD/Config.C | 2 +- FMD/FMDbaseLinkDef.h | 5 ++ FMD/FMDrecLinkDef.h | 2 - FMD/Simulate.C | 2 +- FMD/libFMDbase.pkg | 5 ++ FMD/libFMDrec.pkg | 4 +- 20 files changed, 567 insertions(+), 29 deletions(-) create mode 100644 FMD/AliFMDCalibGain.cxx create mode 100644 FMD/AliFMDCalibGain.h create mode 100644 FMD/AliFMDCalibPedestal.cxx create mode 100644 FMD/AliFMDCalibPedestal.h create mode 100644 FMD/AliFMDFloatMap.cxx create mode 100644 FMD/AliFMDFloatMap.h diff --git a/FMD/AliFMD.cxx b/FMD/AliFMD.cxx index cb4d56ed9fa..a56720e9f81 100644 --- a/FMD/AliFMD.cxx +++ b/FMD/AliFMD.cxx @@ -808,6 +808,8 @@ AliFMD::Hits2Digits() // Create AliFMDDigit's from AliFMDHit's. This is done by making a // AliFMDDigitizer, and executing that code. // + Warning("Hits2Digits", "Try not to use this method.\n" + "Instead, use AliSimulator"); AliRunDigitizer* manager = new AliRunDigitizer(1, 1); manager->SetInputStream(0, "galice.root"); manager->SetOutputFile("H2Dfile"); diff --git a/FMD/AliFMDCalibGain.cxx b/FMD/AliFMDCalibGain.cxx new file mode 100644 index 00000000000..c154410f301 --- /dev/null +++ b/FMD/AliFMDCalibGain.cxx @@ -0,0 +1,70 @@ +/************************************************************************** + * 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$ */ + +//____________________________________________________________________ +// +// +// +#include "AliFMDCalibGain.h" // ALIFMDCALIBGAIN_H +//____________________________________________________________________ +ClassImp(AliFMDCalibGain) +#if 0 + ; // This is here to keep Emacs for indenting the next line +#endif + +//____________________________________________________________________ +AliFMDCalibGain::AliFMDCalibGain() +{ + fValue.Reset(-1.); + fThreshold = -1.; +} + +//____________________________________________________________________ +AliFMDCalibGain::AliFMDCalibGain(const AliFMDCalibGain& o) + : TObject(o), fValue(o.fValue), fThreshold(o.fThreshold) +{} + +//____________________________________________________________________ +AliFMDCalibGain& +AliFMDCalibGain::operator=(const AliFMDCalibGain& o) +{ + fValue = o.fValue; + fThreshold = o.fThreshold; + return (*this); +} + +//____________________________________________________________________ +void +AliFMDCalibGain::Set(UShort_t det, Char_t ring, UShort_t sec, + UShort_t str, Float_t val) +{ + if (fValue.CheckIndex(det, ring, sec, str) < 0) return; + fValue(det, ring, sec, str) = val; +} + +//____________________________________________________________________ +Float_t +AliFMDCalibGain::Value(UShort_t det, Char_t ring, UShort_t sec, + UShort_t str) +{ + return fValue(det, ring, sec, str); +} + +//____________________________________________________________________ +// +// EOF +// diff --git a/FMD/AliFMDCalibGain.h b/FMD/AliFMDCalibGain.h new file mode 100644 index 00000000000..e0c030d8c2b --- /dev/null +++ b/FMD/AliFMDCalibGain.h @@ -0,0 +1,41 @@ +#ifndef ALIFMDCALIBGAIN_H +#define ALIFMDCALIBGAIN_H +/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights + * reserved. + * + * See cxx source for full Copyright notice + */ +#ifndef ALIFMDFLOATMAP_H +# include +#endif +//____________________________________________________________________ +// +// Gain value and width for each strip in the FMD +// +class AliFMDCalibGain : public TObject +{ +public: + AliFMDCalibGain(); + ~AliFMDCalibGain() {} + AliFMDCalibGain(const AliFMDCalibGain& o); + AliFMDCalibGain& operator=(const AliFMDCalibGain& o); + void Set(UShort_t det, Char_t ring, UShort_t sec, UShort_t str, Float_t val); + void Set(Float_t thres) { fThreshold = thres; } + Float_t Value(UShort_t det, Char_t ring, UShort_t sec, UShort_t str); + Float_t Threshold() const { return fThreshold; } +private: + AliFMDFloatMap fValue; + Float_t fThreshold; + ClassDef(AliFMDCalibGain, 1) // Gain data for the FMD +}; + + +#endif +//____________________________________________________________________ +// +// Local Variables: +// mode: C++ +// End: +// + + diff --git a/FMD/AliFMDCalibPedestal.cxx b/FMD/AliFMDCalibPedestal.cxx new file mode 100644 index 00000000000..776cdc06f5c --- /dev/null +++ b/FMD/AliFMDCalibPedestal.cxx @@ -0,0 +1,79 @@ +/************************************************************************** + * 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$ */ + +//____________________________________________________________________ +// +// +// +#include "AliFMDCalibPedestal.h" // ALIFMDCALIBPEDESTAL_H +//____________________________________________________________________ +ClassImp(AliFMDCalibPedestal) +#if 0 + ; // This is here to keep Emacs for indenting the next line +#endif + +//____________________________________________________________________ +AliFMDCalibPedestal::AliFMDCalibPedestal() +{ + fValue.Reset(-1.); + fWidth.Reset(-1.); +} + +//____________________________________________________________________ +AliFMDCalibPedestal::AliFMDCalibPedestal(const AliFMDCalibPedestal& o) + : TObject(o), fValue(o.fValue), fWidth(o.fWidth) +{} + +//____________________________________________________________________ +AliFMDCalibPedestal& +AliFMDCalibPedestal::operator=(const AliFMDCalibPedestal& o) +{ + fValue = o.fValue; + fWidth = o.fWidth; + return (*this); +} + +//____________________________________________________________________ +void +AliFMDCalibPedestal::Set(UShort_t det, Char_t ring, UShort_t sec, + UShort_t str, Float_t ped, Float_t pedW) +{ + if (fValue.CheckIndex(det, ring, sec, str) < 0) return; + fValue(det, ring, sec, str) = ped; + fWidth(det, ring, sec, str) = pedW; +} + +//____________________________________________________________________ +Float_t +AliFMDCalibPedestal::Value(UShort_t det, Char_t ring, UShort_t sec, + UShort_t str) +{ + return fValue(det, ring, sec, str); +} + +//____________________________________________________________________ +Float_t +AliFMDCalibPedestal::Width(UShort_t det, Char_t ring, UShort_t sec, + UShort_t str) +{ + return fValue(det, ring, sec, str); +} + +//____________________________________________________________________ +// +// EOF +// diff --git a/FMD/AliFMDCalibPedestal.h b/FMD/AliFMDCalibPedestal.h new file mode 100644 index 00000000000..202adff839b --- /dev/null +++ b/FMD/AliFMDCalibPedestal.h @@ -0,0 +1,41 @@ +#ifndef ALIFMDCALIBPEDESTAL_H +#define ALIFMDCALIBPEDESTAL_H +/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights + * reserved. + * + * See cxx source for full Copyright notice + */ +#ifndef ALIFMDFLOATMAP_H +# include +#endif +//____________________________________________________________________ +// +// Pedestal value and width for each strip in the FMD +// +class AliFMDCalibPedestal : public TObject +{ +public: + AliFMDCalibPedestal(); + ~AliFMDCalibPedestal() {} + AliFMDCalibPedestal(const AliFMDCalibPedestal& o); + AliFMDCalibPedestal& operator=(const AliFMDCalibPedestal& o); + void Set(UShort_t det, Char_t ring, UShort_t sec, UShort_t str, + Float_t ped, Float_t pedW); + Float_t Value(UShort_t det, Char_t ring, UShort_t sec, UShort_t str); + Float_t Width(UShort_t det, Char_t ring, UShort_t sec, UShort_t str); +private: + AliFMDFloatMap fValue; + AliFMDFloatMap fWidth; + ClassDef(AliFMDCalibPedestal, 1) // Pedestal data for the FMD +}; + + +#endif +//____________________________________________________________________ +// +// Local Variables: +// mode: C++ +// End: +// + + diff --git a/FMD/AliFMDDigitizer.cxx b/FMD/AliFMDDigitizer.cxx index 39748070e1f..bfb9a276f10 100644 --- a/FMD/AliFMDDigitizer.cxx +++ b/FMD/AliFMDDigitizer.cxx @@ -494,7 +494,7 @@ AliFMDDigitizer::Exec(Option_t*) // Get the input loader TString inFolder(fManager->GetInputFolderName(0)); fRunLoader = - AliRunLoader::GetRunLoader(fManager->GetInputFolderName(0)); + AliRunLoader::GetRunLoader(inFolder.Data()); if (!fRunLoader) { AliError("Can not find Run Loader for input stream 0"); return; diff --git a/FMD/AliFMDFloatMap.cxx b/FMD/AliFMDFloatMap.cxx new file mode 100644 index 00000000000..5251a30ce2f --- /dev/null +++ b/FMD/AliFMDFloatMap.cxx @@ -0,0 +1,128 @@ +/************************************************************** + * 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$ */ +//__________________________________________________________ +// +// Map of per strip Float_t information +// +// Created Mon Nov 8 12:51:51 2004 by Christian Holm Christensen +// +#include "AliFMDFloatMap.h" //ALIFMDFLOATMAP_H +//__________________________________________________________ +ClassImp(AliFMDFloatMap) +#if 0 + ; // This is here to keep Emacs for indenting the next line +#endif +//__________________________________________________________ +AliFMDFloatMap::AliFMDFloatMap(const AliFMDFloatMap& other) + : AliFMDMap(other.fMaxDetectors, + other.fMaxRings, + other.fMaxSectors, + other.fMaxStrips), + fData(0) +{ + // Copy constructor + fData = new Float_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips]; + for (size_t i = 0; i < fMaxDetectors * fMaxRings + * fMaxSectors * fMaxStrips; i++) + fData[i] = other.fData[i]; +} + +//__________________________________________________________ +AliFMDFloatMap::AliFMDFloatMap(size_t maxDet, + size_t maxRing, + size_t maxSec, + size_t maxStr) + : AliFMDMap(maxDet, maxRing, maxSec, maxStr), + fData(0) +{ + // Constructor. + // Parameters: + // maxDet Maximum number of detectors + // maxRing Maximum number of rings per detector + // maxSec Maximum number of sectors per ring + // maxStr Maximum number of strips per sector + fData = new Float_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips]; + Reset(); +} + +//__________________________________________________________ +AliFMDFloatMap& +AliFMDFloatMap::operator=(const AliFMDFloatMap& other) +{ + // Assignment operator + fMaxDetectors = other.fMaxDetectors; + fMaxRings = other.fMaxRings; + fMaxSectors = other.fMaxSectors; + fMaxStrips = other.fMaxStrips; + if (fData) delete [] fData; + fData = new Float_t[fMaxDetectors * fMaxRings * fMaxSectors * fMaxStrips]; + for (size_t i = 0; i < fMaxDetectors * fMaxRings + * fMaxSectors * fMaxStrips; i++) + fData[i] = other.fData[i]; + return *this; +} + +//__________________________________________________________ +void +AliFMDFloatMap::Reset(const Float_t& val) +{ + // Reset map to val + for (size_t i = 0; i < fMaxDetectors * fMaxRings + * fMaxSectors * fMaxStrips; i++) + fData[i] = val; +} + +//__________________________________________________________ +Float_t& +AliFMDFloatMap::operator()(UShort_t det, + Char_t ring, + UShort_t sec, + UShort_t str) +{ + // Get data + // Parameters: + // det Detector # + // ring Ring ID + // sec Sector # + // str Strip # + // Returns appropriate data + return fData[CalcIndex(det, ring, sec, str)]; +} + +//__________________________________________________________ +const Float_t& +AliFMDFloatMap::operator()(UShort_t det, + Char_t ring, + UShort_t sec, + UShort_t str) const +{ + // Get data + // Parameters: + // det Detector # + // ring Ring ID + // sec Sector # + // str Strip # + // Returns appropriate data + return fData[CalcIndex(det, ring, sec, str)]; +} + +//__________________________________________________________ +// +// EOF +// + diff --git a/FMD/AliFMDFloatMap.h b/FMD/AliFMDFloatMap.h new file mode 100644 index 00000000000..3f263537511 --- /dev/null +++ b/FMD/AliFMDFloatMap.h @@ -0,0 +1,46 @@ +#ifndef ALIFMDFLOATMAP_H +#define ALIFMDFLOATMAP_H +/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights + * reserved. + * + * See cxx source for full Copyright notice + */ +#ifndef ALIFMDMAP_H +# include +#endif +//____________________________________________________________________ +// +// Array of floats indexed by strip identifier. +// +class AliFMDFloatMap : public AliFMDMap +{ +public: + AliFMDFloatMap(size_t maxDet = kMaxDetectors, + size_t maxRing= kMaxRings, + size_t maxSec = kMaxSectors, + size_t maxStr = kMaxStrips); + AliFMDFloatMap(const AliFMDFloatMap& o); + virtual ~AliFMDFloatMap() { delete [] fData; } + AliFMDFloatMap& operator=(const AliFMDFloatMap& o); + virtual void Reset(const Float_t& v=Float_t()); + virtual Float_t& operator()(UShort_t det, + Char_t ring, + UShort_t sec, + UShort_t str); + virtual const Float_t& operator()(UShort_t det, + Char_t ring, + UShort_t sec, + UShort_t str) const; +protected: + Float_t* fData; + ClassDef(AliFMDFloatMap,1) // Map of floats +}; + +#endif +//____________________________________________________________________ +// +// Local Variables: +// mode: C++ +// End: +// + diff --git a/FMD/AliFMDMultPoisson.cxx b/FMD/AliFMDMultPoisson.cxx index fe11a98f29e..18236d84b02 100644 --- a/FMD/AliFMDMultPoisson.cxx +++ b/FMD/AliFMDMultPoisson.cxx @@ -156,11 +156,20 @@ AliFMDMultPoisson::PostEvent() Float_t theta2 = 2 * TMath::ATan(TMath::Exp(-maxEta)); Float_t minR = TMath::Abs(realZ * TMath::Tan(theta2)); Float_t maxR = TMath::Abs(realZ * TMath::Tan(theta1)); + // Calculate the weighted mean eta of the region + Float_t minW2 = TMath::Power(minR * 2 * TMath::Pi() * + ((maxPhi - minPhi)/360),2); + Float_t maxW2 = TMath::Power(minR * 2 * TMath::Pi() * + ((maxPhi - minPhi)/360), 2); + Float_t meanEta = ((minEta / minW2 + maxEta / maxW2) / + (1 / (minW2 + maxW2))); //UShort_t minStrip = UShort_t((etaIn - maxEta) * stripEta + 0.5); // UShort_t maxStrip = UShort_t((etaIn - minEta) * stripEta + 0.5); - UShort_t minStrip = UShort_t(r->GetNStrips() -(etaIn - minEta) * stripEta + 0.5); - UShort_t maxStrip = UShort_t(r->GetNStrips() -(etaIn - maxEta) * stripEta + 0.5); + UShort_t minStrip = UShort_t(r->GetNStrips() - + (etaIn - minEta) * stripEta + 0.5); + UShort_t maxStrip = UShort_t(r->GetNStrips() - + (etaIn - maxEta) * stripEta + 0.5); AliDebug(10, Form(" Now in eta range %f, %f (strips %d, %d)\n" " [radii %f, %f, thetas %f, %f, sign %d]", @@ -192,7 +201,7 @@ AliFMDMultPoisson::PostEvent() AliFMDMultRegion* m = new((*fMult)[fNMult]) AliFMDMultRegion(sub->GetId(), r->GetId(), minSector, maxSector, minStrip, maxStrip, - minEta, maxEta, minPhi, maxPhi, + minEta, maxEta, meanEta, minPhi, maxPhi, reconstructed, AliFMDMultRegion::kPoission); (void)m; fNMult++; diff --git a/FMD/AliFMDMultRegion.cxx b/FMD/AliFMDMultRegion.cxx index 460c6301888..c73e2a8fa6e 100644 --- a/FMD/AliFMDMultRegion.cxx +++ b/FMD/AliFMDMultRegion.cxx @@ -59,6 +59,7 @@ AliFMDMultRegion::AliFMDMultRegion(UShort_t detector, Char_t ring, UShort_t minSector, UShort_t maxSector, UShort_t minStrip, UShort_t maxStrip, Float_t minEta, Float_t maxEta, + Float_t meanEta, Float_t minPhi, Float_t maxPhi, Float_t particles, UShort_t method) : AliFMDMult(particles, method), @@ -70,10 +71,12 @@ AliFMDMultRegion::AliFMDMultRegion(UShort_t detector, Char_t ring, fMaxStrip(maxStrip), fMinEta(minEta), fMaxEta(maxEta), + fMeanEta(meanEta), fMinPhi(minPhi), fMaxPhi(maxPhi) {} +#if 0 //____________________________________________________________________ Float_t AliFMDMultRegion::Eta() const @@ -137,7 +140,7 @@ AliFMDMultRegion::Eta() const / (fMaxStrip * fMaxStrip + fMinStrip * fMinStrip); return eta; } - +#endif //____________________________________________________________________ void diff --git a/FMD/AliFMDMultRegion.h b/FMD/AliFMDMultRegion.h index 74359f6678a..46ad46c0767 100644 --- a/FMD/AliFMDMultRegion.h +++ b/FMD/AliFMDMultRegion.h @@ -16,14 +16,15 @@ public: AliFMDMultRegion (UShort_t detector, Char_t ring, UShort_t minSector, UShort_t maxSector, UShort_t minStrip, UShort_t maxStrip, - Float_t minEta, Float_t maxEta, + Float_t minEta, Float_t maxEta, + Float_t meanEta, Float_t minPhi, Float_t maxPhi, Float_t particles, UShort_t method); virtual ~AliFMDMultRegion(){}; UShort_t Detector() const { return fDetector; } Char_t Ring() const { return fRing; } - Float_t Eta() const; + Float_t Eta() const { return fMeanEta; } Float_t Phi() const { return (fMaxPhi + fMinPhi) / 2; } UShort_t MinSector() const { return fMinSector; } UShort_t MaxSector() const { return fMaxSector; } @@ -37,16 +38,17 @@ public: protected: UShort_t fDetector; // Detector # Char_t fRing; // Ring ID - UShort_t fMinSector; // First sector of this region - UShort_t fMaxSector; // Last sector of this region - UShort_t fMinStrip; // First strip of this region - UShort_t fMaxStrip; // Second strip of this region + UShort_t fMinSector; // !First sector of this region + UShort_t fMaxSector; // !Last sector of this region + UShort_t fMinStrip; // !First strip of this region + UShort_t fMaxStrip; // !Second strip of this region Float_t fMinEta; // Least eta covered Float_t fMaxEta; // Largest eta covered + Float_t fMeanEta; // Scaled average Eta in the region Float_t fMinPhi; // Least phi covered Float_t fMaxPhi; // Largest phi covered - ClassDef(AliFMDMultRegion,1) // Rec. Multiplicity in a eta,phi region + ClassDef(AliFMDMultRegion,2) // Rec. Multiplicity in a eta,phi region }; #endif //____________________________________________________________________ diff --git a/FMD/AliFMDReconstructor.cxx b/FMD/AliFMDReconstructor.cxx index 88949f26b58..6801f5bfee4 100644 --- a/FMD/AliFMDReconstructor.cxx +++ b/FMD/AliFMDReconstructor.cxx @@ -106,6 +106,7 @@ #include "AliFMDMultAlgorithm.h" // ALIFMDMULTALGORITHM_H #include "AliFMDMultPoisson.h" // ALIFMDMULTPOISSON_H #include "AliFMDMultNaiive.h" // ALIFMDMULTNAIIVE_H +#include "AliESD.h" // ALIESD_H //____________________________________________________________________ ClassImp(AliFMDReconstructor) @@ -201,15 +202,20 @@ AliFMDReconstructor::Init(AliRunLoader* runLoader) return; } AliGenEventHeader* eventHeader = header->GenEventHeader(); - if (!eventHeader) { - Warning("Init", "no event header"); - return; + if (eventHeader) { + TArrayF vtx; + eventHeader->PrimaryVertex(vtx); + fCurrentVertex = vtx[2]; + AliDebug(1, Form("Primary vertex Z coordinate for event # %d/%d is %f", + header->GetRun(), header->GetEvent(), fCurrentVertex)); + Warning("Init", "no generator event header"); + } + else { + Warning("Init", "No generator event header - " + "perhaps we get the vertex from ESD?"); } - TArrayF vtx; - eventHeader->PrimaryVertex(vtx); - fCurrentVertex = vtx[2]; - AliDebug(1, Form("Primary vertex Z coordinate for event # %d/%d is %f", - header->GetRun(), header->GetEvent(), fCurrentVertex)); + // Get the ESD tree + SetESD(new AliESD); } //____________________________________________________________________ @@ -233,6 +239,14 @@ AliFMDReconstructor::Reconstruct(TTree* digitsTree, // FIXME: The vertex may not be known yet, so we may have to move // some of this to FillESD. AliDebug(1, "Reconstructing from digits in a tree"); + + if (fESD) { + const AliESDVertex* vertex = fESD->GetVertex(); + // if (vertex) { + // AliDebug(1, Form("Got vertex from ESD: %f", vertex->GetZv())); + // fCurrentVertex = vertex->GetZv(); + // } + } TBranch *digitBranch = digitsTree->GetBranch("FMD"); if (!digitBranch) { @@ -329,7 +343,35 @@ AliFMDReconstructor::FillESD(TTree* /* digitsTree */, // nothing to be done // FIXME: The vertex may not be known when Reconstruct is executed, // so we may have to move some of that member function here. - +#if 0 + TClonesArray* multStrips = 0; + TClonesArray* multRegions = 0; + TTree* treeR = fmdLoader->TreeR(); + TBranch* branchRegions = treeR->GetBranch("FMDPoisson"); + TBranch* branchStrips = treeR->GetBranch("FMDNaiive"); + branchRegions->SetAddress(&multRegions); + branchStrips->SetAddress(&multStrips); + + Int_t total = 0; + Int_t nEntries = clusterTree->GetEntries(); + for (Int_t entry = 0; entry < nEntries; entry++) { + AliDebug(5, Form("Entry # %d in cluster tree", entry)); + treeR->GetEntry(entry); + + + Int_t nMults = multRegions->GetLast(); + for (Int_t i = 0; i <= nMults; i++) { + AliFMDMultRegion* multR = + static_cast(multRegions->UncheckedAt(i)); + Int_t nParticles=multR->Particles(); + if (i>=0 && i<=13) hEtaPoissonI1->AddBinContent(i+1,nParticles); + if (i>=14 && i<=27 ) hEtaPoissonI2->AddBinContent(i-13,nParticles); + if (i>=28 && i<=33 ); + if (i>=34 && i<=47 ) hEtaPoissonI3->AddBinContent(48-i,nParticles); + if (i>=48 && i<=53) hEtaPoissonO3->AddBinContent(54-i,nParticles); + } + } +#endif } //____________________________________________________________________ diff --git a/FMD/AliFMDReconstructor.h b/FMD/AliFMDReconstructor.h index ddb88b54374..348e5ff3473 100644 --- a/FMD/AliFMDReconstructor.h +++ b/FMD/AliFMDReconstructor.h @@ -42,6 +42,7 @@ class TClonesArray; class AliFMDDigit; class AliRawReader; class AliRunLoader; +class AliESD; //____________________________________________________________________ class AliFMDReconstructor: public AliReconstructor @@ -59,6 +60,7 @@ public: virtual void Reconstruct(TTree* digitsTree, TTree* clusterTree) const; virtual void FillESD(TTree* digitsTree, TTree* clusterTree, AliESD* esd) const; + virtual void SetESD(AliESD* esd) { fESD = esd; } protected: virtual void ProcessDigits(TClonesArray* digits) const; @@ -69,6 +71,7 @@ protected: Float_t fPedestalWidth; // Width of pedestal Float_t fPedestalFactor;// Number of pedestal widths mutable Float_t fCurrentVertex; // Z-coordinate of primary vertex + AliESD* fESD; ClassDef(AliFMDReconstructor, 0) // class for the FMD reconstruction }; diff --git a/FMD/AliFMDSimulator.cxx b/FMD/AliFMDSimulator.cxx index 9f17dad3baf..e4c23fec927 100644 --- a/FMD/AliFMDSimulator.cxx +++ b/FMD/AliFMDSimulator.cxx @@ -386,7 +386,11 @@ AliFMDSimulator::Exec(Option_t* /* option */) Bool_t inside = mc->IsTrackInside(); Bool_t out = (mc->IsTrackExiting()|| mc->IsTrackDisappeared()|| mc->IsTrackStop()); - + static Int_t lastPdg = 0; + static Double_t lastEtot = 0; + static Int_t lastTrack = 0; + static Int_t nBad = 0; + // Reset the energy deposition for this track, and update some of // our parameters. if (entering) { @@ -402,6 +406,64 @@ AliFMDSimulator::Exec(Option_t* /* option */) fCurrentPdg = mc->IdFromPDG(mc->TrackPid()); } + if (mc->Edep() > mc->Etot()/*fCurrentP.E()*/) { + // The track deposited an obscene amount of energy in this step + Int_t trackno = gAlice->GetMCApp()->GetCurrentTrackNumber(); + // TMCProcess process = mc->ProdProcess(trackno); + // TString process_name(TMCProcessName[process]); + TArrayI procs; + mc->StepProcesses(procs); + Int_t currentPdg = mc->TrackPid(); + TString processes; + for (Int_t ip = 0; ip < procs.fN; ip++) { + if (ip != 0) processes.Append(","); + processes.Append(TMCProcessName[procs.fArray[ip]]); + } + // Int_t currentPdg = mc->IdFromPDG(mc->TrackPid()); + TParticlePDG* particleType = TDatabasePDG::Instance()->GetParticle(currentPdg); + TParticlePDG* lastType = TDatabasePDG::Instance()->GetParticle(lastPdg); + TLorentzVector currentV; //! Current hit postition + TLorentzVector currentP; //! Current hit momentum + mc->TrackMomentum(currentP); + mc->TrackPosition(currentV); + TString origin("???"); + if (mc->IsRootGeometrySupported()) { + TGeoNode* node = gGeoManager->FindNode(fCurrentV.X(), fCurrentV.Y(), fCurrentV.Z()); + if (node) origin = node->GetName(); + } + TString what; + if (mc->IsTrackEntering()) what.Append("entering "); + if (mc->IsTrackExiting()) what.Append("exiting "); + if (mc->IsTrackInside()) what.Append("inside "); + if (mc->IsTrackDisappeared()) what.Append("disappeared "); + if (mc->IsTrackStop()) what.Append("stopped "); + if (mc->IsNewTrack()) what.Append("new "); + if (mc->IsTrackAlive()) what.Append("alive "); + if (mc->IsTrackOut()) what.Append("out "); + + Int_t mother = gAlice->GetMCApp()->GetPrimary(trackno); + AliDebug(0, Form("Track # %5d deposited an obsence amout of energy (call # %d)\n" + " Volume: %s\n" + " Momentum: (%8.4f,%8.4f,%8.4f)\n" + " Vertex: (%8.4f,%8.4f,%8.4f) [%s]\n" + " PDG: %d (%s) [last %d (%s)]\n" + " Edep: %-16.8f (mother %d)\n" + " Energy: %-16.8f (last %16.8f from track %d)\n" + " Processes: %s\n" + " What: %s\n", + trackno, nCall, mc->CurrentVolPath(), + currentP.X(), currentP.Y(), currentP.Z(), + currentV.X(), currentV.Y(), currentV.Z(), origin.Data(), + currentPdg, (particleType ? particleType->GetName() : "???"), + lastPdg, (lastType ? lastType->GetName() : "???"), + mc->Edep(), mother, mc->Etot() /*currentP.E()*/, + lastEtot, lastTrack, processes.Data(), what.Data())); + // gAlice->GetMCApp()->DumpPStack(); + // mother->Print(); + nBad++; + if (nBad > 10) exit (1); + } + // If the track is inside, then update the energy deposition if (inside && fCurrentDeltaE >= 0) { fCurrentDeltaE += 1000 * mc->Edep(); @@ -462,6 +524,10 @@ AliFMDSimulator::Exec(Option_t* /* option */) fCurrentDeltaE, fCurrentPdg, fCurrentV.T()); fCurrentDeltaE = -1; } + lastPdg = fCurrentPdg; + lastEtot = mc->Etot(); + lastTrack = gAlice->GetMCApp()->GetCurrentTrackNumber(); + } diff --git a/FMD/Config.C b/FMD/Config.C index f8a5265a78d..0d9eabe010f 100644 --- a/FMD/Config.C +++ b/FMD/Config.C @@ -619,7 +619,7 @@ Config() if (useFMD) { //=================== FMD parameters ============================ AliFMD *FMD = new AliFMDv1("FMD", "normal FMD"); - AliLog::SetModuleDebugLevel("FMD", 10); + AliLog::SetModuleDebugLevel("FMD", 16); } if (useMUON) { diff --git a/FMD/FMDbaseLinkDef.h b/FMD/FMDbaseLinkDef.h index 39c8cffa3a2..44509051256 100644 --- a/FMD/FMDbaseLinkDef.h +++ b/FMD/FMDbaseLinkDef.h @@ -13,6 +13,9 @@ #pragma link C++ class AliFMDDigit+; #pragma link C++ class AliFMDSDigit+; #pragma link C++ class AliFMDMap+; +#pragma link C++ class AliFMDFloatMap+; +#pragma link C++ class AliFMDBoolMap+; +#pragma link C++ class AliFMDUShortMap+; #pragma link C++ class AliFMD1+; #pragma link C++ class AliFMD2+; #pragma link C++ class AliFMD3+; @@ -20,6 +23,8 @@ #pragma link C++ class AliFMDDetector+; #pragma link C++ class AliFMDGeometry+; #pragma link C++ class AliFMDParameters+; +#pragma link C++ class AliFMDCalibPedestal+; +#pragma link C++ class AliFMDCalibGain+; #else # error Not for compilation diff --git a/FMD/FMDrecLinkDef.h b/FMD/FMDrecLinkDef.h index 7de18d3085b..b9134995fe7 100644 --- a/FMD/FMDrecLinkDef.h +++ b/FMD/FMDrecLinkDef.h @@ -13,8 +13,6 @@ // #pragma link C++ class AliFMDMap; // #pragma link C++ typedef AliFMDAdcMap; -#pragma link C++ class AliFMDUShortMap+; -#pragma link C++ class AliFMDBoolMap+; #pragma link C++ class AliFMDReconstructor+; #pragma link C++ class AliFMDMultAlgorithm+; #pragma link C++ class AliFMDMultNaiive+; diff --git a/FMD/Simulate.C b/FMD/Simulate.C index 54c59f460ed..002804d6640 100644 --- a/FMD/Simulate.C +++ b/FMD/Simulate.C @@ -22,7 +22,7 @@ Simulate() AliSimulation sim; sim.SetConfigFile("$(ALICE)/FMD/Config.C"); // sim.SetMakeSDigits("FMD"); - // sim.SetMakeDigits("FMD"); + sim.SetMakeDigits("FMD"); sim.SetWriteRawData("FMD"); // sim.SetMakeDigitsFromHits("FMD"); sim.Run(1); diff --git a/FMD/libFMDbase.pkg b/FMD/libFMDbase.pkg index 5f565af3568..a484c001615 100644 --- a/FMD/libFMDbase.pkg +++ b/FMD/libFMDbase.pkg @@ -4,6 +4,11 @@ SRCS = AliFMDDigit.cxx \ AliFMDMap.cxx \ + AliFMDFloatMap.cxx \ + AliFMDBoolMap.cxx \ + AliFMDUShortMap.cxx \ + AliFMDCalibPedestal.cxx \ + AliFMDCalibGain.cxx \ AliFMDParameters.cxx \ AliFMDGeometry.cxx \ AliFMDRing.cxx \ diff --git a/FMD/libFMDrec.pkg b/FMD/libFMDrec.pkg index a5da33cf9db..cacfcef0ed6 100644 --- a/FMD/libFMDrec.pkg +++ b/FMD/libFMDrec.pkg @@ -10,9 +10,7 @@ SRCS = AliFMDReconstructor.cxx \ AliFMDMultPoisson.cxx \ AliFMDMultRegion.cxx \ AliFMDMult.cxx \ - AliFMDMultStrip.cxx \ - AliFMDUShortMap.cxx \ - AliFMDBoolMap.cxx + AliFMDMultStrip.cxx HDRS = $(SRCS:.cxx=.h) DHDR := FMDrecLinkDef.h EINCLUDE := $(ALICE)/RAW -- 2.39.3