}
-Int_t AliEMCALJetFinderInputSimPrep::FillFromFile(TString *filename, AliEMCALJetFinderFileType_t filetype,Int_t EventNumber)
+Int_t AliEMCALJetFinderInputSimPrep::FillFromFile(TString *filename, AliEMCALJetFinderFileType_t filetype,Int_t EventNumber,TString data="H")
{
if (fDebug > 1) Info("FillFromFile","Beginning FillFromFile");
fFileType = filetype;
AliEMCALGetter *gime = AliEMCALGetter::Instance(filename->Data());
if (fDebug > 1) Info("FillFromFile","Instantiated Getter with %s as the file",filename->Data());
- gime->Event(EventNumber,"XH") ;
+ if (data.Contains("S"))
+ {
+ gime->Event(EventNumber,"XS") ;
+ }else
+ {
+ gime->Event(EventNumber,"XH") ;
+ }
if (fDebug > 1) Info("FillFromFile","Got event %i with option \"XH\"",EventNumber);
if ( fEMCALType == kHits ||
- fEMCALType == kTimeCut ) FillHits();
+ fEMCALType == kTimeCut )
+ {
+ if (data.Contains("S"))
+ {
+ FillSDigits();
+ }else
+ {
+ FillHits();
+ }
+ }
if ( fTrackType != kNoTracks ) FillTracks();
if ( fFileType != kData){
FillPartons();
{
// Fill digits to input object
+}
+void AliEMCALJetFinderInputSimPrep::FillSDigits()
+{
+Info("FillSDigits","Beginning FillSDigits");
+ AliEMCALGetter *gime = AliEMCALGetter::Instance();
+
+ // Fill digits to input object
+ for (Int_t towerid=0; towerid < gime->SDigits()->GetEntries(); towerid++)
+ {
+ fInputObject.AddEnergyToDigit(gime->SDigit(towerid)->GetId(), gime->SDigit(towerid)->GetAmp());
+ }
+
}
void AliEMCALJetFinderInputSimPrep::Smear(TParticle *particle)
void Reset(AliEMCALJetFinderResetType_t resettype);
void SetEMCALType(AliEMCALJetFinderEMCALType_t emcaltype ) {fEMCALType = emcaltype;}
//void SetDebug(Int_t debug = 0) {fDebug = debug;}
- void SetSmearingType(AliEMCALJetFinderSmearingType_t smeartype ) {fSmearType = smeartype;}
+ void SetSmearingType(AliEMCALJetFinderSmearingType_t smeartype ) {fSmearType = smeartype;}
void SetTrackType(AliEMCALJetFinderTrackType_t tracktype){fTrackType = tracktype;}
- void SetEfficiency(Float_t efficiency) {fEfficiency = efficiency; }
+ void SetEfficiency(Float_t efficiency) {fEfficiency = efficiency;}
void SetTimeCut(Float_t timecut) {fTimeCut = timecut; fEMCALType = kTimeCut;}
- Int_t FillFromFile(TString *filename, AliEMCALJetFinderFileType_t filetype,Int_t EventNumber);
+ Int_t FillFromFile(TString *filename, AliEMCALJetFinderFileType_t filetype,Int_t EventNumber,TString data);
AliEMCALJetFinderInput* GetJetFinderInput(){return &fInputObject;}
private:
void FillHits(); // Fill from the hits to input object from simulation
+ void FillSDigits(); // Fill from the hits to input object from simulation
void FillTracks(); // Fill from particles simulating a TPC to input object from simulation
void Smear(TParticle *particle);
Bool_t Efficiency();
// TH2F *fhInputOutput; //("hJetEtRatio2","Ratio of Second Highest to Highest",100,0,1);
fhRecoBinPt=0; // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
+fhRecoBinPtNoBg=0; // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
fhRecoBinPartonPt=0; // ("fhRecoBinPartonPt","Input Pt Distribution",100,0,1);
fhRecoBinJetEt=0; // ("fhRecoJetEt","E_{T}^{reco}",250,0.,250.);
fhRecoBinInputJetEt=0; // ("fhRecoInputJetEt","E_{T}^{reco}",250,0.,250.);
fhRecoBinPt =new TH1F("fhRecoBinPt","Reconstructed Pt Distribution",200,0,200);
fhRecoBinPt->Sumw2();
+fhRecoBinPtNoBg =new TH1F("fhRecoBinPtNoBg","Reconstructed Pt Distribution Background Subtracted",200,0,200);
+fhRecoBinPtNoBg->Sumw2();
fhRecoBinPartonPt = new TH1F("fhRecoBinPartonPt","Input Pt Distribution",200,0,200);
fhRecoBinPartonPt->Sumw2();
fhRecoBinFragmFcn =new TH1F("fhRecoBinFragmFcn","Reconstructed Frag. Fcn",200,0,2);
delete fhEtaPhiDist2; //("hEtaPhiDist2","Angular Distance Between First and Second",100,0,3);
delete fhRecoBinPt; // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
+ delete fhRecoBinPtNoBg; // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
delete fhRecoBinPartonPt; // ("fhRecoBinPartonPt","Input Pt Distribution",100,0,1);
delete fhRecoBinJetEt; // ("fhRecoJetEt","E_{T}^{reco}",250,0.,250.);
delete fhRecoBinInputJetEt; // ("fhRecoInputJetEt","E_{T}^{reco}",250,0.,250.);
if (!fInitialised) InitPlots();
fOutput = output;
if (!fOutput) return;
+// Make some temporary histograms to make sure we subtract
+ // background properly
+/*
+tempFragmFcnNoBg =new TH1F("tempFragmFcnNoBg","Reconstructed Frag. Fcn With Background Removed",200,0,2);
+tempPtNoBg =new TH1F("tempPtNoBg","Reconstructed Frag. Fcn With Background Removed",200,0,200);
+tempFragmFcnNoBg->Fill(count/(jethighest->Energy()*fScaleFactor),-fhBackHisto->GetBinContent(count));
+tempPtNoBg->AddBinContent(count,-fhBackHisto->GetBinContent(count));
+*/
+
fhNJets->Fill(fOutput->GetNJets());
Bool_t doesJetMeetBinCriteria = 0;
AliEMCALJet* jethighest=0;
if (doesJetMeetBinCriteria)
{
fhRecoBinPt->Fill(correctp*sin(tt)); // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
+ fhRecoBinPtNoBg->Fill(correctp*sin(tt)); // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
fhRecoBinFragmFcn->Fill( correctp*sin(tt)/(jethighest->Energy()*fScaleFactor) ); // This is the jet fragmentation function
fhRecoBinFragmFcnNoBg->Fill( correctp*sin(tt)/(jethighest->Energy()*fScaleFactor) ); // This is the jet fragmentation function
}
Double_t correctp = pt[iT]/stt;
fhJetPL->Fill( correctp*cos(alpha));
if ( (jet->Eta()-eta[iT])*(jet->Eta()-eta[iT]) +
- (jet->Phi()-phi[iT])*(jet->Phi()-phi[iT]) < 0.2*0.2 )
+ (jet->Phi()-phi[iT])*(jet->Phi()-phi[iT]) < 0.2*0.2 )
fhJetJT->Fill( correctp*sin(alpha));
fhJetPT->Fill(correctp*sin(tt));
if (fNominalEnergy==0.0){
if (doesJetMeetBinCriteria)
{
fhRecoBinPt->Fill(correctp*sin(tt)); // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
+ fhRecoBinPtNoBg->Fill(correctp*sin(tt)); // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
fhRecoBinFragmFcn->Fill( correctp*sin(tt)/(jet->Energy()*fScaleFactor) ); // This is the jet fragmentation function
fhRecoBinFragmFcnNoBg->Fill( correctp*sin(tt)/(jet->Energy()*fScaleFactor) ); // This is the jet fragmentation function
}
}// loop over tracks
}
-if (numappjet>=1 && fhBackHisto != 0)
+if (numappjet>=1 && fhBackHisto != 0 && doesJetMeetBinCriteria)
{
for (Int_t count=1;count<=100;count++)
{
- fhRecoBinFragmFcnNoBg->AddBinContent(count,-fhBackHisto->GetBinContent(count));
+ fhRecoBinFragmFcnNoBg->Fill( ((Float_t)count)/(jethighest->Energy()*fScaleFactor),-fhBackHisto->GetBinContent(count));
+ fhRecoBinPtNoBg->AddBinContent(count,-fhBackHisto->GetBinContent(count));
}
}
//============================== Reconstruction Bin Comparison ============================================
TH1F* GetRecoBinPt(){return fhRecoBinPt;} // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
+ TH1F* GetRecoBinPtNoBg(){return fhRecoBinPtNoBg;} // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
TH1F* GetRecoBinPartonPt(){return fhRecoBinPartonPt;} // ("fhRecoBinPartonPt","Input Pt Distribution",100,0,1);
TH1F* GetRecoBinJetEt(){return fhRecoBinJetEt;} // ("fhRecoJetEt","E_{T}^{reco}",250,0.,250.);
TH1F* GetRecoBinInputJetEt(){return fhRecoBinInputJetEt;} // ("fhRecoInputJetEt","E_{T}^{reco}",250,0.,250.);
//============================== Reconstruction Bin Comparison ============================================
TH1F *fhRecoBinPt; // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
+ TH1F *fhRecoBinPtNoBg; // ("fhRecoBinPt","Reconstructed Pt Distribution",100,0,1);
TH1F *fhRecoBinPartonPt; // ("fhRecoBinPartonPt","Input Pt Distribution",100,0,1);
TH1F *fhRecoBinJetEt; // ("fhRecoJetEt","E_{T}^{reco}",250,0.,250.);
TH1F *fhRecoBinInputJetEt; // ("fhRecoInputJetEt","E_{T}^{reco}",250,0.,250.);