]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALJetFinderInputSimPrep.cxx
Modified plots and made jet finder use SDigits
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALJetFinderInputSimPrep.cxx
index 83376187163019e5476cbd8d12214b0529a23a6c..4940c519de460e56ea21c7b4e90adb2ceea18559 100755 (executable)
@@ -110,17 +110,32 @@ if (fDebug > 1) Info("Reset","Beginning Reset");
 
 }
 
-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();
@@ -148,7 +163,6 @@ if (fDebug > 1) Info("FillHits","Beginning FillHits");
 //
 //   Loop over tracks
 //
-    Int_t nbytes = 0;
     Double_t etH = 0.0;
 
 /*    for (Int_t track=0; track<ntracks;track++) {
@@ -198,7 +212,7 @@ void AliEMCALJetFinderInputSimPrep::FillTracks()
     TParticle *mPart;
     Int_t npart = (gAlice->GetHeader())->GetNprimary();
     if (fDebug > 1) Info("FillTracks","Header says there are %i primaries",npart);
-    AliEMCALGetter *gime = AliEMCALGetter::Instance();
+    //AliEMCALGetter *gime = AliEMCALGetter::Instance();
     Float_t bfield,rEMCAL;              
 /*     for (Int_t i =0; i<gime->NPrimaries(); i++)
        {
@@ -268,7 +282,7 @@ void AliEMCALJetFinderInputSimPrep::FillTracks()
         switch(fTrackType)
         {
 
-          case kAll:  // All Stable particles to be included
+          case kAllP:  // All Stable particles to be included
                if (fDebug > 5) Info("FillTracks","Storing track");
                if (fSmearType == kSmear ||
                    fSmearType == kSmearEffic ){
@@ -366,6 +380,45 @@ void AliEMCALJetFinderInputSimPrep::FillTracks()
           break;
           case kNoTracks:
           break;
+          case kEMChargedPi0:
+               if (pdgP->Charge() != 0 || mPart->GetPdgCode() == kPi0  ||
+                       mPart->GetPdgCode() == kGamma     )
+               {
+                       if (fDebug > 5) Info("FillTracks","Storing charged track");
+                       if (fSmearType == kSmear ||
+                           fSmearType == kSmearEffic ){
+                               Smear(mPart);/*
+                               TParticle *tmp = Smear(MPart);
+                               fInputObject.AddTrack(tmp);
+                               delete tmp;*/
+                       }else{
+                        fInputObject.AddTrack(*mPart);
+                       }
+               }
+          break;
+          case kNoNeutronNeutrinoKlong:
+               if ( mPart->GetPdgCode() != kNeutron    &&
+                    mPart->GetPdgCode() != kNeutronBar &&
+                    mPart->GetPdgCode() != kK0Long     &&
+                    mPart->GetPdgCode() != kNuE        &&
+                     mPart->GetPdgCode() != kNuEBar     &&
+                     mPart->GetPdgCode() != kNuMu       &&
+                     mPart->GetPdgCode() != kNuMuBar    &&
+                     mPart->GetPdgCode() != kNuTau      &&
+                     mPart->GetPdgCode() != kNuTauBar   )
+               {
+                       if (fDebug > 5) Info("FillTracks","Storing charged track");
+                       if (fSmearType == kSmear ||
+                                       fSmearType == kSmearEffic ){
+                               Smear(mPart);/*
+                                               TParticle *tmp = Smear(MPart);
+                                               fInputObject.AddTrack(tmp);
+                                               delete tmp;*/
+                       }else{
+                               fInputObject.AddTrack(*mPart);
+                       }
+               }
+          break;
           default:
           break;
           delete mPart;
@@ -442,7 +495,7 @@ if (fDebug > 1) Info("FillParticles","Beginning FillParticles");
         switch(fTrackType)
         {
 
-          case kAll:  // All Stable particles to be included
+          case kAllP:  // All Stable particles to be included
                if (fDebug > 5) Info("FillParticles","Storing particle");
                fInputObject.AddParticle(mPart);
           break;
@@ -487,6 +540,45 @@ if (fDebug > 1) Info("FillParticles","Beginning FillParticles");
           break;
           case kNoTracks:
           break;
+          case kEMChargedPi0:
+               if (pdgP->Charge() != 0 || mPart->GetPdgCode() == kPi0  ||
+                       mPart->GetPdgCode() == kGamma     )
+               {
+                       if (fDebug > 5) Info("FillTracks","Storing kEMChargedPi0 track");
+                       if (fSmearType == kSmear ||
+                           fSmearType == kSmearEffic ){
+                               Smear(mPart);/*
+                               TParticle *tmp = Smear(MPart);
+                               fInputObject.AddTrack(tmp);
+                               delete tmp;*/
+                       }else{
+                        fInputObject.AddTrack(*mPart);
+                       }
+               }
+          break;
+          case kNoNeutronNeutrinoKlong:
+               if ( mPart->GetPdgCode() != kNeutron    &&
+                    mPart->GetPdgCode() != kNeutronBar &&
+                    mPart->GetPdgCode() != kK0Long     &&
+                    mPart->GetPdgCode() != kNuE        &&
+                     mPart->GetPdgCode() != kNuEBar     &&
+                     mPart->GetPdgCode() != kNuMu       &&
+                     mPart->GetPdgCode() != kNuMuBar    &&
+                     mPart->GetPdgCode() != kNuTau      &&
+                     mPart->GetPdgCode() != kNuTauBar   )
+               {
+                       if (fDebug > 5) Info("FillTracks","Storing kNoNeutronNeutrinoKlong track");
+                       if (fSmearType == kSmear ||
+                                       fSmearType == kSmearEffic ){
+                               Smear(mPart);/*
+                                               TParticle *tmp = Smear(MPart);
+                                               fInputObject.AddTrack(tmp);
+                                               delete tmp;*/
+                       }else{
+                               fInputObject.AddTrack(*mPart);
+                       }
+               }
+          break;
           default:
           break;
         }      //end of switch
@@ -497,6 +589,18 @@ void AliEMCALJetFinderInputSimPrep::FillDigits()
 {
        // 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)