At the moment the pseudorapidity is calculated instead of being taken from the ESDs. I need to understand the differences I observe between these two before changing this.
: fDebug(0),
fOutputList(0),
fInputList(0),
+ fHitList(0),
fArray(0),
fInputArray(0),
fVertexString(0x0),
fDebug(0),
fOutputList(0),
fInputList(0),
+ fHitList(0),
fArray(),
fInputArray(0),
fVertexString(0x0),
if(!fOutputList)
fOutputList = new TList();
fOutputList->SetName("BackgroundCorrectedPerEvent");
+ if(!fHitList)
+ fHitList = new TList();
+ fHitList->SetName("HitsList");
TH2F* hMult = 0;
nSec, 0, 2*TMath::Pi());
hHits->Sumw2();
+ fHitList->Add(hHits);
fOutputList->Add(hHits);
vtxArray->AddAtAndExpand(hMult,i);
fDebug(o.fDebug),
fOutputList(0),
fInputList(0),
+ fHitList(0),
fArray(o.fArray),
fInputArray(o.fInputArray),
fVertexString(o.fVertexString),
void SetOutputVertex(TObjString* vtxString) {fOutputVertexString = vtxString;}
//void SetInputVtx(TObjString* vtxString) {fVertexString = vtxString;}
void SetOutputList(TList* outputList) {fOutputList = outputList;}
-
+ void SetHitList(TList* hitList) {fHitList = hitList;}
private:
Int_t fDebug; // Debug flag
TList* fOutputList;
TList* fInputList;
+ TList* fHitList;
TObjArray fArray;
TObjArray* fInputArray;
TObjString* fVertexString;
#include "AliStack.h"
#include "AliESDVertex.h"
#include "AliFMDAnaParameters.h"
-
+#include "AliFMDGeometry.h"
ClassImp(AliFMDAnalysisTaskCollector)
for(UShort_t sec =0; sec < nsec; sec++) {
for(UShort_t strip = 0; strip < nstr; strip++) {
- Float_t eta = fmd->Eta(det,ring,sec,strip);
+
+
+ Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
+ if(mult == AliESDFMD::kInvalidMult || mult == 0) continue;
+ AliFMDGeometry* geo = AliFMDGeometry::Instance();
+
+ Double_t x,y,z;
+ geo->Detector2XYZ(det,ring,sec,strip,x,y,z);
+
+ Double_t r = TMath::Sqrt(x*x+y*y);
+
+ Double_t z_real = z-vertex[2];
+ Double_t theta = TMath::ATan2(r,z_real);
+ // std::cout<<"From EtaFromStrip "<<theta<<std::endl;
+ Double_t eta = -1*TMath::Log(TMath::Tan(0.5*theta));
+ //Float_t eta = fmd->Eta(det,ring,sec,strip);
Int_t nEta = hBg->GetXaxis()->FindBin(eta);
-
+
TObjArray* etaArray = (TObjArray*)fArray->At(nEta);
TObjArray* detArray = (TObjArray*)etaArray->At(det);
TH1F* Edist = (TH1F*)detArray->At(ir);
- Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
- if(mult == AliESDFMD::kInvalidMult || mult == 0) continue;
+
Edist->Fill(mult);
}
#include "AliESDVertex.h"
#include "TMath.h"
#include "AliFMDAnaParameters.h"
+#include "AliFMDParameters.h"
#include "AliFMDGeometry.h"
#include "AliFMDRing.h"
for(UShort_t strip = 0; strip < nstr; strip++) {
Float_t mult = fESD->Multiplicity(det,ring,sec,strip);
Float_t eta = fESD->Eta(det,ring,sec,strip);
- Float_t mult_cut = 0.2;
+
if(mult == 0 || mult == AliESDFMD::kInvalidMult) continue;
//Particle number cut goes here...
+ Double_t x,y,z;
+ geo->Detector2XYZ(det,ring,sec,strip,x,y,z);
+ Float_t phi = TMath::ATan2(y,x);
+ if(phi<0)
+ phi = phi+2*TMath::Pi();
+ Float_t r = TMath::Sqrt(TMath::Power(x,2)+TMath::Power(y,2));
+ Float_t theta = TMath::ATan2(r,z-vertex[2]);
+ Float_t etacalc = -1*TMath::Log(TMath::Tan(0.5*theta));
+ eta = etacalc;
+
+ Float_t m = pars->GetMPV(det,ring,eta);
+ Float_t s = pars->GetSigma(det,ring,eta);
+ AliFMDParameters* recopars = AliFMDParameters::Instance();
+
+ Float_t mult_cut = m-2*s; //0.15;//0.2;//m-3*s;// 0.2;//0.01;//m-2*s;//0.2;
+
+ mult_cut = (4*recopars->GetPedestalWidth(det,ring,sec,strip))/(recopars->GetPulseGain(det,ring,sec,strip)*recopars->GetDACPerMIP());
+
Float_t nParticles = 0;
if(fESD->GetUniqueID() == kTRUE) {
//proton + proton
- if(mult > mult_cut)
+
+ if(mult > mult_cut) {
nParticles = 1;
+
+ }
}
else {
3*beta*TMath::Landau(mult,3*mpv+3*sigma*TMath::Log(3),3*sigma,kTRUE);
- if(mult > 0){//mult_cut) {
+ if(mult > mult_cut) {
if(sumCor) nParticles = weight / sumCor;
else nParticles = 1;
+
}
//std::cout<<sumCor<<" "<<weight<<" "<<" "<<mult<<" "<<nParticles<<std::endl;
}
- Double_t x,y,z;
- geo->Detector2XYZ(det,ring,sec,strip,x,y,z);
- Float_t phi = TMath::ATan2(y,x);
- if(phi<0)
- phi = phi+2*TMath::Pi();
+
+
+
Float_t correction = GetAcceptanceCorrection(ring,strip);
if(correction) nParticles = nParticles / correction;
- hMult->Fill(eta,phi,nParticles);
+ if(nParticles > 0)
+ hMult->Fill(eta,phi,nParticles);
+ //if(det == 1 && ring =='I' && nParticles >0)
+ // std::cout<<mult<<" "<<sec<<" "<<strip<<" "<<eta<<" "<<phi<<" "<<etacalc<<std::endl;
}
}
#include "AliFMDAnaParameters.h"
#include "AliFMDGeometry.h"
#include "AliGenEventHeader.h"
+#include "AliHeader.h"
#include "TDatabasePDG.h"
#include "TParticlePDG.h"
+#include "AliFMDStripIndex.h"
ClassImp(AliFMDAnalysisTaskDndeta)
fNevents(),
fNMCevents(),
fStandalone(kTRUE),
- fMCevent(0)
+ fMCevent(0),
+ fLastTrackByStrip()
{
// Default constructor
DefineInput (0, TList::Class());
fNevents(),
fNMCevents(),
fStandalone(kTRUE),
- fMCevent(0)
+ fMCevent(0),
+ fLastTrackByStrip()
{
fStandalone = SE;
if(fStandalone) {
TH2F* hMult = 0;
+ TH1F* hHits = 0;
TH1F* hPrimVertexBin = 0;
hBg->GetXaxis()->GetXmin(),
hBg->GetXaxis()->GetXmax(),
nSec, 0, 2*TMath::Pi());
+
+ hHits = new TH1F(Form("hHits_FMD%d%c_vtxbin%d",det,ringChar,i),Form("hHits_FMD%d%c_vtxbin%d",det,ringChar,i),
+ hBg->GetNbinsX(),
+ hBg->GetXaxis()->GetXmin(),
+ hBg->GetXaxis()->GetXmax());
+
+
+
hMult->Sumw2();
+ hHits->Sumw2();
fOutputList->Add(hMult);
+ fOutputList->Add(hHits);
vtxArray->AddAtAndExpand(hMult,i);
}
}
//_____________________________________________________________________
void AliFMDAnalysisTaskDndeta::ProcessPrimary() {
-
+
+ fLastTrackByStrip.Reset(-1);
+
AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
AliMCParticle* particle = 0;
AliStack* stack = fMCevent->Stack();
TH1F* hPrimary = (TH1F*)fOutputList->FindObject("hMultvsEta");
+ AliHeader* header = fMCevent->Header();
+ AliGenEventHeader* genHeader = header->GenEventHeader();
+
+ TArrayF vertex;
+ genHeader->PrimaryVertex(vertex);
+ if(TMath::Abs(vertex.At(2)) > pars->GetVtxCutZ())
+ return;
+ Double_t delta = 2*pars->GetVtxCutZ()/pars->GetNvtxBins();
+ Double_t vertexBinDouble = (vertex.At(2) + pars->GetVtxCutZ()) / delta;
+ Int_t vertexBin = (Int_t)vertexBinDouble;
Bool_t firstTrack = kTRUE;
Int_t nTracks = fMCevent->GetNumberOfTracks();
particle = fMCevent->GetTrack(i);
if(!particle)
continue;
- if(TMath::Abs(particle->Zv()) > pars->GetVtxCutZ())
- continue;
if(stack->IsPhysicalPrimary(i) && particle->Charge() != 0) {
hPrimary->Fill(particle->Eta());
- Double_t delta = 2*pars->GetVtxCutZ()/pars->GetNvtxBins();
- Double_t vertexBinDouble = (particle->Zv() + pars->GetVtxCutZ()) / delta;
- Int_t vertexBin = (Int_t)vertexBinDouble;
+
TH1F* hPrimVtxBin = (TH1F*)fOutputList->FindObject(Form("primmult_vtxbin%d",vertexBin));
hPrimVtxBin->Fill(particle->Eta());
firstTrack = kFALSE;
}
}
+
+ for(Int_t j=0; j<particle->GetNumberOfTrackReferences();j++) {
+ AliTrackReference* ref = particle->GetTrackReference(j);
+ UShort_t det,sec,strip;
+ Char_t ring;
+ if(ref->DetectorId() != AliTrackReference::kFMD)
+ continue;
+ AliFMDStripIndex::Unpack(ref->UserId(),det,ring,sec,strip);
+ Float_t thisStripTrack = fLastTrackByStrip.operator()(det,ring,sec,strip);
+ if(particle->Charge() != 0 && i != thisStripTrack ) {
+ Double_t x,y,z;
+ AliFMDGeometry* fmdgeo = AliFMDGeometry::Instance();
+ fmdgeo->Detector2XYZ(det,ring,sec,strip,x,y,z);
+
+ Float_t phi = TMath::ATan2(y,x);
+ if(phi<0) phi = phi+2*TMath::Pi();
+ Float_t r = TMath::Sqrt(TMath::Power(x,2)+TMath::Power(y,2));
+ Float_t theta = TMath::ATan2(r,z-vertex.At(2));
+ Float_t eta = -1*TMath::Log(TMath::Tan(0.5*theta));
+ TH1F* hHits = (TH1F*)fOutputList->FindObject(Form("hHits_FMD%d%c_vtxbin%d",det,ring,vertexBin));
+ hHits->Fill(eta);
+ Float_t nstrips = (ring =='O' ? 256 : 512);
+
+ // if(det == 1 && ring == 'I')
+ // std::cout<<"hit in FMD 1I "<<sec<<" "<<strip<<" "<<eta<<" "<<phi<<std::endl;
+ fLastTrackByStrip.operator()(det,ring,sec,strip) = (Float_t)i;
+
+ if(strip >0)
+ fLastTrackByStrip.operator()(det,ring,sec,strip-1) = (Float_t)i;
+ if(strip < (nstrips - 1))
+ fLastTrackByStrip.operator()(det,ring,sec,strip+1) = (Float_t)i;
+
+
+ }
+ }
+
+
}
-
-
-
-
}
//_____________________________________________________________________
//
#include "TArrayI.h"
#include "TH1I.h"
#include "AliMCEvent.h"
-
+#include "AliFMDFloatMap.h"
class AliFMDAnalysisTaskDndeta : public AliAnalysisTask
{
public:
fNevents(o.fNevents),
fNMCevents(o.fNMCevents),
fStandalone(o.fStandalone),
- fMCevent(o.fMCevent) {}
+ fMCevent(o.fMCevent),
+ fLastTrackByStrip(o.fLastTrackByStrip) {}
AliFMDAnalysisTaskDndeta& operator=(const AliFMDAnalysisTaskDndeta&) { return *this; }
// Implementation of interface methods
virtual void ConnectInputData(Option_t *option = "");
TH1I fNMCevents;
Bool_t fStandalone;
AliMCEvent* fMCevent;
+ AliFMDFloatMap fLastTrackByStrip;
ClassDef(AliFMDAnalysisTaskDndeta, 0); // Analysis task for FMD analysis
};
fBackground.SetInputList(densitylist);
fBackground.SetOutputList(bgcorlist);
+ fBackground.SetHitList(fListOfHistos);
fBackground.SetOutputVertex(vtxString1);
fDndeta.SetInputVertex(vtxString1);
if(mult == AliESDFMD::kInvalidMult || mult == 0) continue;
- Double_t eta = fmd->Eta(det,ring,sec,strip);//EtaFromStrip(det,ring,sec,strip,vertex[2]);
+ Double_t eta = EtaFromStrip(det,ring,sec,strip,vertex[2]);//fmd->Eta(det,ring,sec,strip);
//std::cout<<EtaFromStrip(det,ring,sec,strip,vertex[2]) <<" "<<fmd->Eta(det,ring,sec,strip)<<std::endl;
hEdist->Fill(mult);
if(fmd->IsAngleCorrected())
- mult = mult/TMath::Cos(Eta2Theta(fmd->Eta(det,ring,sec,strip)));
+ mult = mult/TMath::Cos(Eta2Theta(eta));
Float_t Eprev = 0;
Float_t Enext = 0;
if(strip != 0)
Float_t Enext,
UShort_t det,
Char_t ring,
- UShort_t /*sec*/,
- UShort_t /*strip*/) {
+ UShort_t sec,
+ UShort_t strip) {
AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
Float_t merged_energy = 0;
- Float_t nParticles = 0;
- Float_t cutLow = 0.2;
- Float_t cutHigh = pars->GetMPV(det,ring,eta) -1*pars->GetSigma(det,ring,eta);
+ //Float_t nParticles = 0;
+ Float_t cutLow = 0.15;
+ AliFMDParameters* recopars = AliFMDParameters::Instance();
+ cutLow = (4*recopars->GetPedestalWidth(det,ring,sec,strip))/(recopars->GetPulseGain(det,ring,sec,strip)*recopars->GetDACPerMIP());
+
+
+
+ Float_t cutHigh = pars->GetMPV(det,ring,eta);// - pars->GetSigma(det,ring,eta);
// Float_t cutPart = pars->GetMPV(det,ring,eta) - 5*pars->GetSigma(det,ring,eta);
Float_t Etotal = mult;
//if(mult > 5)
// std::cout<<mult<<" "<<det<<" "<<ring<<" "<<sec<<" "<<strip<<std::endl;
+ //Float_t slow_particle_cut = 2*pars->GetMPV(det,ring,eta);
- if(foutputESDFMD->GetUniqueID() == kTRUE) {
+ //if(recopars->IsDead(det,ring,sec,strip))
+ // std::cout<<"dead channel"<<std::endl;
+ //if(foutputESDFMD->GetUniqueID() == kTRUE) {
+ // Float_t mpv = pars->GetMPV(det,ring,eta);
+
+ /*
+ if(foutputESDFMD->GetUniqueID() == kFALSE) {
+ if(mult > 15)
+ return 0;
+
if(mult > cutLow ) {
fEnergy = fEnergy + mult;
fNstrips++;
}
- if((Enext <0.01 && fEnergy >0) || fNstrips >2 ) {
-
- //if((fEnergy*TMath::Cos(Eta2Theta(eta))) > cutPart || fNstrips > 1) {
+ if( (Enext < cutLow && fEnergy > 0 ) || fNstrips >2 ){
+
+ //if((fEnergy*TMath::Cos(Eta2Theta(eta))) > cutPart || fNstrips > 1) {
nParticles = 1;
merged_energy = fEnergy*TMath::Cos(Eta2Theta(eta));
TH1F* hEdist = (TH1F*)fDiagList.FindObject(Form("Edist_after_sharing_FMD%d%c",det,ring));
hEdist->Fill(fEnergy);
TH1F* hNstrips = (TH1F*)fDiagList.FindObject(Form("N_strips_hit_FMD%d%c",det,ring));
hNstrips->Fill(fNstrips);
- // std::cout<<Form("Merged signals %f %f %f into %f , %f in strip %d, sec %d, ring %c, det %d",Eprev, mult, Enext, fEnergy/TMath::Cos(Eta2Theta(eta)),fEnergy,strip,sec,ring,det )<<std::endl;
+ // std::cout<<Form("Merged signals %f %f %f into %f , %f in det %d, ring %c, sec %d, strip %d",Eprev, mult, Enext, fEnergy/TMath::Cos(Eta2Theta(eta)),fEnergy,det,ring,sec,strip )<<std::endl;
// }
// else
//std::cout<<Form("NO HIT for %f %f %f into %f , %f in strip %d, sec %d, ring %c, det %d, cuts %f , %f",Eprev, mult, Enext, fEnergy/TMath::Cos(Eta2Theta(eta)),fEnergy,strip,sec,ring,det,cutPart,cutHigh )<<std::endl;
+
+ fEnergy = 0;
+ fNstrips = 0;
- fEnergy = 0;
- fNstrips = 0;
return merged_energy;
+ }
+
+
+ return 0;
+
}
-
- return 0;
-
- }
- else {
-
+ else {*/
+ //std::cout<<det<<ring<<" "<<sec<<" "<<strip<<" "<<cutLow<<std::endl;
if(fSharedThis) {
fSharedThis = kFALSE;
fSharedPrev = kTRUE;
return 0.;
}
- if(mult < cutLow) {
+ /* if(mult < 0.33*pars->GetMPV(det,ring,eta)) {
fSharedThis = kFALSE;
fSharedPrev = kFALSE;
return 0;
- }
+ }*/
+ if(mult<Enext && Enext>cutHigh && foutputESDFMD->GetUniqueID() == kTRUE)
+ {
+ fSharedThis = kFALSE;
+ fSharedPrev = kFALSE;
+ return 0;
+ }
+ if(mult > 15)
+ {
+ std::cout<<"rejecting hit in FMD "<<det<<" "<<ring<<std::endl;
+ fSharedThis = kFALSE;
+ fSharedPrev = kFALSE;
+ return 0;
+ }
if(Eprev > cutLow && Eprev < cutHigh && !fSharedPrev ) {
Etotal += Eprev;
Etotal = Etotal*TMath::Cos(Eta2Theta(eta));
if(Etotal > 0) {
+
merged_energy = Etotal;
fSharedPrev = kTRUE;
- //if(det == 3 && ring =='I')
- // std::cout<<Form("Merged signals %f %f %f into %f , %f in strip %d, sec %d, ring %c, det %d",Eprev, mult, Enext, Etotal/TMath::Cos(Eta2Theta(eta)),Etotal,strip,sec,ring,det )<<std::endl;
+ // if(det == 1 && ring =='I')
+ // std::cout<<Form("Merged signals %f %f %f into %f , %f in strip %d, sec %d, ring %c, det %d",Eprev, mult, Enext, Etotal/TMath::Cos(Eta2Theta(eta)),Etotal,strip,sec,ring,det )<<std::endl;
}
else{// if(Etotal > 0) {
//if(det == 3 && ring =='I')
// merged_energy = mult;
return merged_energy;
- }
+ //}
}
//_____________________________________________________________________
void AliFMDAnalysisTaskSharing::GetVertex(Double_t* vertexXYZ)
if(eta < 0)
theta = theta-TMath::Pi();
- std::cout<<"From eta2Theta: "<<theta<<" "<<eta<<std::endl;
+ // std::cout<<"From eta2Theta: "<<theta<<" "<<eta<<std::endl;
return theta;