@@ -191,7 +191,6 @@ struct ZdcQVectors {
191191
192192 TProfile3D* shiftprofileC = nullptr ;
193193 TProfile3D* shiftprofileA = nullptr ;
194-
195194 bool isShiftProfileFound = false ;
196195
197196 } cal;
@@ -640,6 +639,10 @@ struct ZdcQVectors {
640639
641640 cal.calibfilesLoaded [2 ] = false ;
642641 cal.calibList [2 ] = nullptr ;
642+
643+ cal.isShiftProfileFound = false ;
644+ cal.shiftprofileC = nullptr ;
645+ cal.shiftprofileA = nullptr ;
643646 }
644647
645648 const auto & zdcCol = foundBC.zdc ();
@@ -922,20 +925,18 @@ struct ZdcQVectors {
922925 double deltaPsiZDCA = 0 ;
923926 double deltaPsiZDCC = 0 ;
924927
925- if (!cfgCCDBdir_Shift.value .empty ()) {
926- if (lastRunNumber != runnumber) {
927- cal.isShiftProfileFound = false ;
928+ if (!cfgCCDBdir_Shift.value .empty () && cal.isShiftProfileFound == false ) {
928929 LOGF (info, " Getting shift profile from CCDB for runnumber: %d" , runnumber);
929930 TList* hcorrList = ccdb->getForTimeStamp <TList>(cfgCCDBdir_Shift.value , foundBC.timestamp ());
930931 cal.shiftprofileC = reinterpret_cast <TProfile3D*>(hcorrList->FindObject (" ShiftZDCC" ));
931932 cal.shiftprofileA = reinterpret_cast <TProfile3D*>(hcorrList->FindObject (" ShiftZDCA" ));
932933 if (!cal.shiftprofileC || !cal.shiftprofileA ) {
933934 LOGF (error, " Shift profile not found in CCDB for runnumber: %d" , runnumber);
935+ cal.isShiftProfileFound = false ;
934936 } else {
935- LOGF (error , " Shift profile found in CCDB for runnumber: %d" , runnumber);
937+ LOGF (info , " Shift profile found in CCDB for runnumber: %d" , runnumber);
936938 cal.isShiftProfileFound = true ;
937939 }
938- }
939940 }
940941
941942 for (int ishift = 1 ; ishift <= nshift; ishift++) {
@@ -950,8 +951,8 @@ struct ZdcQVectors {
950951 float coeffshiftxZDCA = 0.0 ;
951952 float coeffshiftyZDCA = 0.0 ;
952953
953- for ( int ishift = 1 ; ishift <= nshift; ishift++ ) {
954- if (cal. isShiftProfileFound ) {
954+ if (cal. isShiftProfileFound ) {
955+ for ( int ishift = 1 ; ishift <= nshift; ishift++ ) {
955956 int binshiftxZDCC = cal.shiftprofileC ->FindBin (centrality, 0.5 , ishift - 0.5 ); // bin 0.5
956957 int binshiftyZDCC = cal.shiftprofileC ->FindBin (centrality, 1.5 , ishift - 0.5 );
957958 int binshiftxZDCA = cal.shiftprofileA ->FindBin (centrality, 0.5 , ishift - 0.5 );
@@ -965,9 +966,10 @@ struct ZdcQVectors {
965966 coeffshiftxZDCA = cal.shiftprofileA ->GetBinContent (binshiftxZDCA);
966967 if (binshiftyZDCA > 0 )
967968 coeffshiftyZDCA = cal.shiftprofileA ->GetBinContent (binshiftyZDCA);
969+
970+ deltaPsiZDCC += ((2 / (1.0 * ishift)) * (-1.0 * coeffshiftxZDCC * std::cos (ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * std::sin (ishift * 1.0 * psiZDCC)));
971+ deltaPsiZDCA += ((2 / (1.0 * ishift)) * (-1.0 * coeffshiftxZDCA * std::cos (ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * std::sin (ishift * 1.0 * psiZDCA)));
968972 }
969- deltaPsiZDCC += ((2 / (1.0 * ishift)) * (-1.0 * coeffshiftxZDCC * std::cos (ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * std::sin (ishift * 1.0 * psiZDCC)));
970- deltaPsiZDCA += ((2 / (1.0 * ishift)) * (-1.0 * coeffshiftxZDCA * std::cos (ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * std::sin (ishift * 1.0 * psiZDCA)));
971973 }
972974
973975 psiZDCCshift += deltaPsiZDCC;
0 commit comments