|
39 | 39 | #include <string> |
40 | 40 | #include <vector> |
41 | 41 |
|
| 42 | +// o2 includes. |
| 43 | +#include "CCDB/BasicCCDBManager.h" |
| 44 | +#include "CCDB/CcdbApi.h" |
| 45 | + |
42 | 46 | using namespace o2; |
43 | 47 | using namespace o2::framework; |
44 | 48 | using namespace o2::framework::expressions; |
45 | 49 | using namespace o2::soa; |
46 | 50 |
|
47 | 51 | struct lambdaspincorrderived { |
| 52 | + |
| 53 | + struct : ConfigurableGroup { |
| 54 | + Configurable<std::string> cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; |
| 55 | + Configurable<int64_t> nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; |
| 56 | + } cfgCcdbParam; |
| 57 | + |
| 58 | + // Enable access to the CCDB for the offset and correction constants and save them in dedicated variables. |
| 59 | + Service<o2::ccdb::BasicCCDBManager> ccdb; |
| 60 | + o2::ccdb::CcdbApi ccdbApi; |
| 61 | + TH3D* hweight1; |
| 62 | + TH3D* hweight2; |
| 63 | + TH3D* hweight3; |
| 64 | + |
| 65 | + Configurable<std::string> ConfWeightPathLL{"ConfWeightPathLL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; |
| 66 | + Configurable<std::string> ConfWeightPathALAL{"ConfWeightPathALAL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; |
| 67 | + Configurable<std::string> ConfWeightPathLAL{"ConfWeightPathLAL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; |
| 68 | + |
48 | 69 | // event sel///////// |
49 | 70 | Configurable<float> centMin{"centMin", 0, "Minimum Centrality"}; |
50 | 71 | Configurable<float> centMax{"centMax", 80, "Maximum Centrality"}; |
51 | 72 |
|
52 | 73 | // Lambda selection //////////// |
| 74 | + Configurable<bool> useweight{"useweight", 1, "Use weight"}; |
53 | 75 | Configurable<bool> usePDGM{"usePDGM", 1, "Use PDG mass"}; |
54 | 76 | Configurable<bool> checkDoubleStatus{"checkDoubleStatus", 0, "Check Double status"}; |
55 | 77 | Configurable<float> cosPA{"cosPA", 0.995, "Cosine Pointing Angle"}; |
@@ -101,6 +123,16 @@ struct lambdaspincorrderived { |
101 | 123 | histos.add("hSparseLambdaLambdaMixed", "hSparseLambdaLambdaMixed", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisCentrality, configThnAxisR}, true); |
102 | 124 | histos.add("hSparseLambdaAntiLambdaMixed", "hSparseLambdaAntiLambdaMixed", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisCentrality, configThnAxisR}, true); |
103 | 125 | histos.add("hSparseAntiLambdaAntiLambdaMixed", "hSparseAntiLambdaAntiLambdaMixed", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisCentrality, configThnAxisR}, true); |
| 126 | + |
| 127 | + ccdb->setURL(cfgCcdbParam.cfgURL); |
| 128 | + ccdbApi.init("http://alice-ccdb.cern.ch"); |
| 129 | + ccdb->setCaching(true); |
| 130 | + ccdb->setLocalObjectValidityChecking(); |
| 131 | + ccdb->setCreatedNotAfter(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count()); |
| 132 | + LOGF(info, "Getting alignment offsets from the CCDB..."); |
| 133 | + hweight1 = ccdb->getForTimeStamp<TH3D>(ConfWeightPathLL.value, cfgCcdbParam.nolaterthan.value); |
| 134 | + hweight2 = ccdb->getForTimeStamp<TH3D>(ConfWeightPathALAL.value, cfgCcdbParam.nolaterthan.value); |
| 135 | + hweight3 = ccdb->getForTimeStamp<TH3D>(ConfWeightPathLAL.value, cfgCcdbParam.nolaterthan.value); |
104 | 136 | } |
105 | 137 |
|
106 | 138 | template <typename T> |
@@ -210,14 +242,22 @@ struct lambdaspincorrderived { |
210 | 242 | histos.fill(HIST("hAntiLambdaSameForALAL"), particle1.Pt(), particle1.Eta(), RecoDecay::constrainAngle(particle1.Phi(), 0.0F)); |
211 | 243 | } |
212 | 244 | } else if (datatype == 1) { |
| 245 | + double weight1 = 1.0; |
| 246 | + double weight2 = 1.0; |
| 247 | + double weight3 = 1.0; |
| 248 | + if (useweight) { |
| 249 | + weight1 = hweight1->GetBinContent(hweight1->FindBin(particle1.Pt() + 0.001, particle1.Eta() + 0.001, particle1.Phi() + 0.001)); |
| 250 | + weight2 = hweight2->GetBinContent(hweight2->FindBin(particle1.Pt() + 0.001, particle1.Eta() + 0.001, particle1.Phi() + 0.001)); |
| 251 | + weight3 = hweight3->GetBinContent(hweight3->FindBin(particle1.Pt() + 0.001, particle1.Eta() + 0.001, particle1.Phi() + 0.001)); |
| 252 | + } |
213 | 253 | if (tag1 == 0 && tag2 == 0) { |
214 | | - histos.fill(HIST("hSparseLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR); |
| 254 | + histos.fill(HIST("hSparseLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR, weight1); |
215 | 255 | histos.fill(HIST("hLambdaMixForLL"), particle1.Pt(), particle1.Eta(), RecoDecay::constrainAngle(particle1.Phi(), 0.0F)); |
216 | 256 | } else if ((tag1 == 0 && tag2 == 1) || (tag1 == 1 && tag2 == 0)) { |
217 | | - histos.fill(HIST("hSparseLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR); |
| 257 | + histos.fill(HIST("hSparseLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR, weight2); |
218 | 258 | histos.fill(HIST("hLambdaMixForLAL"), particle1.Pt(), particle1.Eta(), RecoDecay::constrainAngle(particle1.Phi(), 0.0F)); |
219 | 259 | } else if (tag1 == 1 && tag2 == 1) { |
220 | | - histos.fill(HIST("hSparseAntiLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR); |
| 260 | + histos.fill(HIST("hSparseAntiLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, centrality, deltaR, weight3); |
221 | 261 | histos.fill(HIST("hAntiLambdaMixForALAL"), particle1.Pt(), particle1.Eta(), RecoDecay::constrainAngle(particle1.Phi(), 0.0F)); |
222 | 262 | } |
223 | 263 | } |
|
0 commit comments