Coverity + minor changes
authorfreidt <freidt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Mar 2013 14:13:24 +0000 (14:13 +0000)
committerfreidt <freidt@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 18 Mar 2013 14:13:24 +0000 (14:13 +0000)
PWGUD/DIFFRACTIVE/example/AliAnalysisTaskCDex.cxx
PWGUD/DIFFRACTIVE/example/AliCDMesonUtilsStripped.cxx
PWGUD/DIFFRACTIVE/example/runEx.C
PWGUD/DIFFRACTIVE/xsAndTwoProng/AliAnalysisTaskCDMeson.cxx
PWGUD/DIFFRACTIVE/xsAndTwoProng/AliCDMesonBase.cxx
PWGUD/DIFFRACTIVE/xsAndTwoProng/AliCDMesonUtils.cxx
PWGUD/DIFFRACTIVE/xsAndTwoProng/runMesonGrid.C

index 0976a95..977c892 100644 (file)
@@ -309,7 +309,8 @@ Bool_t AliAnalysisTaskCDex::DetermineGap()
                aodTree->GetEvent(Entry()); // seems to be needed! (loads current event)
                if (!fCurrentGapCondition) {
                        fCurrentGapCondition = 0xfffe;
-                       puts("freidtlog - error while gap condition determination using AODs\n");
+                       puts("AliAnalysisTaskCDex - ");
+                       puts("error while gap condition determination using AODs\n");
                        return kFALSE;
                }
        }
@@ -329,7 +330,8 @@ Bool_t AliAnalysisTaskCDex::DetermineGap()
 
                if (!fCurrentGapCondition) {
                        fCurrentGapCondition = 0xfffe;
-                       puts("freidtlog - error while gap condition determination using ESDs\n");
+                       puts("AliAnalysisTaskCDex - ");
+                       puts("error while gap condition determination using ESDs\n");
                        return kFALSE;
                }
        }
index 12bf8bb..405e14e 100644 (file)
@@ -251,7 +251,7 @@ void AliCDMesonUtilsStripped::SPDLoadGeom(Int_t run)
 
        AliCDBEntry* obj = man->Get(AliCDBPath("GRP", "Geometry", "Data"));
        if (!obj) {
-               printf("freidtlog failed loading geometry object\n");
+               printf("AliCDMesonUtilsStripped failed loading geometry object\n");
                return;
        }
        AliGeomManager::SetGeometry((TGeoManager*)obj->GetObject());
@@ -269,7 +269,7 @@ Bool_t AliCDMesonUtilsStripped::SPDLoc2Glo(Int_t id, const Double_t *loc,
        static TGeoHMatrix mat;
        Int_t vid = AliITSAlignMille2Module::GetVolumeIDFromIndex(id);
        if (vid<0) {
-               printf("freidtlog Did not find module with such ID %d\n",id);
+               printf("AliCDMesonUtilsStripped Did not find module with such ID %d\n",id);
                return kFALSE;
        }
        AliITSAlignMille2Module::SensVolMatrix(vid,&mat);
index 9cde329..8f2498e 100644 (file)
@@ -167,12 +167,12 @@ void runEx(
        // OUTPUT --------------------------------------------------------------------
        // output filename
        Char_t foutname[100];
-       sprintf(foutname,"freidt_%s.root",taskname);
+       sprintf(foutname,"diffExample_%s.root",taskname);
 
        // output containers
        // in AnalysisTaskSE, slot 0 reserved, must start from 1
        AliAnalysisDataContainer* output =
-               mgr->CreateContainer("freidt_Hist", TList::Class(),
+               mgr->CreateContainer("diffExample_Hist", TList::Class(),
                                     AliAnalysisManager::kOutputContainer,foutname);
        task->ConnectOutput(1, output);
 
index 7e622b8..3e89cac 100644 (file)
@@ -215,6 +215,11 @@ AliAnalysisTaskCDMeson::AliAnalysisTaskCDMeson(const char* name, Long_t state):
 
        for (Int_t iGap = 0; iGap < kMax; ++iGap) {
                fGapInformation[iGap] = 0;
+               fGapInformationWCent[iGap] = 0;
+       }
+
+       for (Int_t i = 0; i < 3; ++i) {
+               fMomentum[i] = 0.;
        }
 
        // reset track pair pointers
@@ -359,6 +364,15 @@ AliAnalysisTaskCDMeson::AliAnalysisTaskCDMeson():
        // default constructor (should not be used)
        //
 
+       for (Int_t iGap = 0; iGap < kMax; ++iGap) {
+               fGapInformation[iGap] = 0;
+               fGapInformationWCent[iGap] = 0;
+       }
+
+       for (Int_t i = 0; i < 3; ++i) {
+               fMomentum[i] = 0.;
+       }
+
        fTrkPair[0] = 0x0;
        fTrkPair[1] = 0x0;
 }
@@ -954,7 +968,7 @@ void AliAnalysisTaskCDMeson::UserCreateOutputObjects()
        }
        //= PWA TREE =================================================================
        if (!fAnalysisStatus || fAnalysisStatus & AliCDMesonBase::kBitPWAtree) {
-               fPWAtree = new TTree("freidt_pwa", "pwa");
+               fPWAtree = new TTree("cd_pwa", "pwa");
                fPWAtree->Branch("theta", &fTheta);
                fPWAtree->Branch("phi", &fPhi);
                fPWAtree->Branch("m", &fMass);
@@ -974,7 +988,7 @@ void AliAnalysisTaskCDMeson::UserExec(Option_t *)
 {
        //
        // Executed for every event which passed the physics selection
-       // 
+       //
 
        //printf("Entry: %ld\n", (Long_t)Entry()); // print current event number
 
@@ -1039,7 +1053,7 @@ void AliAnalysisTaskCDMeson::UserExec(Option_t *)
 
        //= EVENT SELECTION ==========================================================
        Int_t kfo =
-               (fAnalysisStatus & AliCDMesonBase::kBitFastORStudy & !fDoAOD) ? 1 : 0;
+               ((fAnalysisStatus & AliCDMesonBase::kBitFastORStudy) && !fDoAOD) ? 1 : 0;
        Int_t ninnerp=-999, nouterp=-999;
        Bool_t eventIsValid = (fDoAOD) ?
                AliCDMesonUtils::CutEvent(fAODEvent, fhpriv, fPriVtxX, fPriVtxY, fPriVtxZ,
@@ -1227,22 +1241,24 @@ Bool_t AliAnalysisTaskCDMeson::CheckInput()
        fPIDResponse = (AliPIDResponse*)fInputHandler->GetPIDResponse();
 
        if(!fESDEvent && !fAODEvent){
-               printf("freidtlog No valid event\n");
+               printf("AliAnalysisTaskCDMeson No valid event\n");
                return kFALSE;
        }
-       
+
        if(!fPIDResponse){
-               printf("freidtlog No PIDd\n");
+               printf("AliAnalysisTaskCDMeson No PIDd\n");
                // PID is fixed to unknown
                //return kFALSE;
        }
 
-       if(fDoAOD && fabs(fAODEvent->GetMagneticField())<1){
-               printf("freidtlog strange Bfield! %f\n", fAODEvent->GetMagneticField());
+       if(fDoAOD && fAODEvent && fabs(fAODEvent->GetMagneticField())<1){
+               printf("AliAnalysisTaskCDMeson strange Bfield! %f\n",
+                      fAODEvent->GetMagneticField());
                return kFALSE;
        }
-       else if((!fDoAOD) && fabs(fESDEvent->GetMagneticField())<1){
-               printf("freidtlog strange Bfield! %f\n", fESDEvent->GetMagneticField());
+       else if((!fDoAOD) && fESDEvent && fabs(fESDEvent->GetMagneticField())<1){
+               printf("AliAnalysisTaskCDMeson strange Bfield! %f\n",
+                      fESDEvent->GetMagneticField());
                return kFALSE;
        }
 
@@ -1280,7 +1296,7 @@ void AliAnalysisTaskCDMeson::DoEmptyEventStudy() {
        //
 
 
-       if (!fAnalysisStatus & AliCDMesonBase::kBitEEStudy) {
+       if (!(fAnalysisStatus & AliCDMesonBase::kBitEEStudy)) {
                // check whether empty event analysis is activated
                return;
        }
@@ -1350,7 +1366,7 @@ Bool_t AliAnalysisTaskCDMeson::DetermineGap()
                }
                if (!fCurrentGapCondition) {
                        fCurrentGapCondition = 0xfffe;
-                       puts("freidtlog - error while gap condition determination using AODs\n");
+                       puts("AliAnalysisTaskCDMeson - error while gap condition determination using AODs\n");
                        return kFALSE;
                }
                // DEBUGGING STUFF
@@ -1360,14 +1376,14 @@ Bool_t AliAnalysisTaskCDMeson::DetermineGap()
                //aodTree->GetEvent(Entry());
                //aodTree->Show();
                //TBranch* branch = aodTree->GetBranch("gapCondition");
-               //printf("freidtlog - branch=x%x\n",branch);
+               //printf("AliAnalysisTaskCDMeson - branch=x%x\n",branch);
                //if (!fCurrentGapCondition) {
                //branch->SetAddress(&fCurrentGapCondition);
                        //}
                //Int_t entry = Entry();
                //printf("Entry()=%d\n", entry);
                //branch->GetEvent(entry);
-               //printf("freidtlog - gapcondition=0x%x\n", fCurrentGapCondition);
+               //printf("AliAnalysisTaskCDMeson - gapcondition=0x%x\n", fCurrentGapCondition);
        }
        else {
                if (fAnalysisStatus & AliCDMesonBase::kBitReadPreprocessedGap) {
@@ -1394,11 +1410,11 @@ Bool_t AliAnalysisTaskCDMeson::DetermineGap()
                }
                if (!fCurrentGapCondition) {
                        fCurrentGapCondition = 0xfffe;
-                       puts("freidtlog - error while gap condition determination using ESDs\n");
+                       puts("AliAnalysisTaskCDMeson - error while gap condition determination using ESDs\n");
                        return kFALSE;
                }
        }
-       //printf("freidtlog - Event: %ld, gapCondition: 0x%x\n", (Long_t)Entry(),
+       //printf("AliAnalysisTaskCDMeson - Event: %ld, gapCondition: 0x%x\n", (Long_t)Entry(),
        //       fCurrentGapCondition);
 
 
index 308dbcc..a0ce09e 100644 (file)
@@ -117,13 +117,13 @@ Int_t AliCDMesonBase::GetAxis(TString thntit, TString name)
                thntit = thntit(pos+1, thntit.Length()-pos);
                counter++;
                if(counter>=nmax-1){
-                       printf("freidtlog AliCDMesonBase::GetAxis too small nmax! %d %d\n",
+                       printf("AliCDMesonBase AliCDMesonBase::GetAxis too small nmax! %d %d\n",
                               counter, nmax);
                        return -1; //exit(1); // TODO
                }
        }
        tits[counter++] = thntit;
-       
+
        //----------------
 
        name.ToUpper();
@@ -132,11 +132,12 @@ Int_t AliCDMesonBase::GetAxis(TString thntit, TString name)
          if( tits[ii] == name )
                  return ii;
        }
-       printf("freidtlog AliCDMesonBase::GetAxis !%s! %s not found!\n", name.Data(),
-              thntit.Data());
+       printf("AliCDMesonBase AliCDMesonBase::GetAxis !%s! %s not found!\n",
+              name.Data(), thntit.Data());
        for(Int_t ii=0; ii<counter; ii++){
                printf("*************** AliCDMesonBase::GetAxis *****************\n");
-               printf("freidtlog AliCDMesonBase::GetAxis %d !%s!\n", ii, tits[ii].Data());
+               printf("AliCDMesonBase AliCDMesonBase::GetAxis %d !%s!\n", ii,
+                      tits[ii].Data());
                printf("\n");
        }
        return -1; //exit(1); // TODO
index 4aa4ad2..f19b4ae 100644 (file)
@@ -332,9 +332,9 @@ Bool_t AliCDMesonUtils::CutEvent(const AliESDEvent *ESDEvent, TH1 *hspd,
 
        AliTriggerAnalysis triggerAnalysis;
        /*
-       //printf("freidtlog active triggers: %s\n",
+       //printf("AliCDMesonUtils active triggers: %s\n",
        //       ESDEvent->GetHeader()->GetActiveTriggerInputs().Data());
-       //printf("freidtlog fired triggers: %s\n",
+       //printf("AliCDMesonUtils fired triggers: %s\n",
        //       ESDEvent->GetHeader()->GetFiredTriggerInputs().Data());
        //*/
        //http://alisoft.cern.ch/viewvc/trunk/ANALYSIS/AliTriggerAnalysis.cxx?view=markup&root=AliRoot
@@ -488,16 +488,19 @@ void AliCDMesonUtils::DoVZEROStudy(const AliESDEvent *ESDEvent,
        man->SetRun(run);
 
        AliCDBEntry *ent1 = man->Get("VZERO/Trigger/Data");
+       if (!ent1) {
+               printf("AliCDMesonUtils failed loading VZERO trigger data from OCDB\n");
+       }
        AliVZEROTriggerData *trigData = (AliVZEROTriggerData*)ent1->GetObject();
        if (!trigData) {
-               printf("freidtlog failed loading VZERO trigger data from OCDB\n");
+               printf("AliCDMesonUtils failed loading VZERO trigger data from OCDB\n");
                return;
        }
 
        AliCDBEntry *ent2 = man->Get("VZERO/Calib/Data");
        AliVZEROCalibData *calData = (AliVZEROCalibData*)ent2->GetObject();
        if (!calData) {
-               printf("freidtlog failed loading VZERO calibration data from OCDB\n");
+               printf("AliCDMesonUtils failed loading VZERO calibration data from OCDB\n");
                return;
        }
 
@@ -798,7 +801,7 @@ Int_t AliCDMesonUtils::GetTPC(const AliESDEvent * ESDEvent, TH2 *TPCGapDCAaSide,
                esdtrack->GetImpactParameters(b,bCov);
 
                if (bCov[0]<=0 || bCov[2]<=0) {
-                       printf("freidtlog - Estimated b resolution lower or equal zero!\n");
+                       printf("AliCDMesonUtils - Estimated b resolution lower or equal zero!\n");
                        bCov[0]=0;
                        bCov[2]=0;
                }
@@ -926,16 +929,16 @@ void AliCDMesonUtils::SPDLoadGeom(const Int_t run)
 
        AliCDBEntry* obj = man->Get(AliCDBPath("GRP", "Geometry", "Data"));
        if (!obj) {
-               printf("freidtlog failed loading geometry object\n");
+               printf("AliCDMesonUtils failed loading geometry object\n");
                return;
        }
        AliGeomManager::SetGeometry((TGeoManager*)obj->GetObject());
-       AliGeomManager::ApplyAlignObjsFromCDB("ITS"); 
+       AliGeomManager::ApplyAlignObjsFromCDB("ITS");
 }
 
 //------------------------------------------------------------------------------
 Bool_t AliCDMesonUtils::SPDLoc2Glo(const Int_t id, const Double_t *loc,
-                                   Double_t *glo) 
+                                   Double_t *glo)
 {
        //
        //SPDLoc2Glo, do not touch
@@ -944,7 +947,7 @@ Bool_t AliCDMesonUtils::SPDLoc2Glo(const Int_t id, const Double_t *loc,
        static TGeoHMatrix mat;
        Int_t vid = AliITSAlignMille2Module::GetVolumeIDFromIndex(id);
        if (vid<0) {
-               printf("freidtlog Did not find module with such ID %d\n",id);
+               printf("AliCDMesonUtils Did not find module with such ID %d\n",id);
                return kFALSE;
        }
        AliITSAlignMille2Module::SensVolMatrix(vid,&mat);
index e07472f..e653342 100644 (file)
@@ -204,8 +204,8 @@ void runMeson(
        // output filename
        Char_t foutname[100];
        Char_t foutnamePWA[100];
-       sprintf(foutname,"freidt_%s.root",taskname);
-       sprintf(foutnamePWA,"freidt_%sPWA.root",taskname);
+       sprintf(foutname,"cd_%s.root",taskname);
+       sprintf(foutnamePWA,"cd_%sPWA.root",taskname);
 
        // output containers
        // in AnalysisTaskSE, slot 0 reserved, must start from 1
@@ -215,7 +215,7 @@ void runMeson(
        Int_t nOutputs = 0;
 
        outlist[nOutputs] =
-               mgr->CreateContainer("freidt_Hist", TList::Class(),
+               mgr->CreateContainer("cd_Hist", TList::Class(),
                                     AliAnalysisManager::kOutputContainer,foutname);
        nOutputs++;
        mgr->ConnectOutput(task, nOutputs, outlist[nOutputs-1]);
@@ -224,7 +224,7 @@ void runMeson(
            || ((taskConfig & AliCDMesonBase::kBitSoftTracks)
                && (taskConfig & AliCDMesonBase::kBitTHnMother))) {
                outlist[nOutputs] =
-                       mgr->CreateContainer("freidt_ThnMother", THnSparse::Class(),
+                       mgr->CreateContainer("cd_ThnMother", THnSparse::Class(),
                                             AliAnalysisManager::kOutputContainer,foutname);
                nOutputs++;
                mgr->ConnectOutput(task, nOutputs, outlist[nOutputs-1]);
@@ -232,7 +232,7 @@ void runMeson(
 
        if (!taskConfig || (taskConfig & AliCDMesonBase::kBitSoftTracks)) {
                outlist[nOutputs] =
-                       mgr->CreateContainer("freidt_ThnMotherSoft", THnSparse::Class(),
+                       mgr->CreateContainer("cd_ThnMotherSoft", THnSparse::Class(),
                                             AliAnalysisManager::kOutputContainer,foutname);
                nOutputs++;
                mgr->ConnectOutput(task, nOutputs, outlist[nOutputs-1]);
@@ -240,7 +240,7 @@ void runMeson(
 
        if (!taskConfig || (taskConfig & AliCDMesonBase::kBitMultStudy)) {
                outlist[nOutputs] =
-                       mgr->CreateContainer("freidt_ThnMultiplicity", THnSparse::Class(),
+                       mgr->CreateContainer("cd_ThnMultiplicity", THnSparse::Class(),
                                             AliAnalysisManager::kOutputContainer,foutname);
                nOutputs++;
                mgr->ConnectOutput(task, nOutputs, outlist[nOutputs-1]);
@@ -248,14 +248,14 @@ void runMeson(
 
        if (!taskConfig || (taskConfig & AliCDMesonBase::kBitTHnMC)) {
                outlist[nOutputs] =
-                       mgr->CreateContainer("freidt_ThnMotherMC", THnSparse::Class(),
+                       mgr->CreateContainer("cd_ThnMotherMC", THnSparse::Class(),
                                             AliAnalysisManager::kOutputContainer,foutname);
                nOutputs++;
                mgr->ConnectOutput(task, nOutputs, outlist[nOutputs-1]);
        }
        if (!taskConfig || (taskConfig & AliCDMesonBase::kBitPWAtree)) {
                outlist[nOutputs] =
-                       mgr->CreateContainer("freidt_PWA", TTree::Class(),
+                       mgr->CreateContainer("cd_PWA", TTree::Class(),
                                             AliAnalysisManager::kOutputContainer,foutnamePWA);
                nOutputs++;
                mgr->ConnectOutput(task, nOutputs, outlist[nOutputs-1]);