Skip to content

Commit e65913a

Browse files
authored
Please consider the following formatting changes (#339)
1 parent 0c68d19 commit e65913a

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

Common/TableProducer/multiplicityExtraTable.cxx

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,33 @@ struct MultiplicityExtraTable {
3535

3636
Produces<aod::Mults2BC> mult2bc;
3737
Produces<aod::BC2Mults> bc2mult;
38-
38+
3939
// Allow for downscaling of BC table for less space use in derived data
4040
Configurable<float> bcDownscaleFactor{"bcDownscaleFactor", 2, "Downscale factor for BC table (0: save nothing, 1: save all)"};
4141
Configurable<float> minFT0CforBCTable{"minFT0CforBCTable", 25.0f, "Minimum FT0C amplitude to fill BC table to reduce data"};
42-
42+
4343
// needed for downscale
4444
unsigned int randomSeed = 0;
45-
45+
4646
o2::ccdb::CcdbApi ccdbApi;
4747
Service<o2::ccdb::BasicCCDBManager> ccdb;
4848
BCPattern CollidingBunch;
49-
49+
5050
int newRunNumber = -999;
5151
int oldRunNumber = -999;
52-
52+
5353
void init(InitContext&)
5454
{
5555
randomSeed = static_cast<unsigned int>(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count());
56-
56+
5757
ccdbApi.init("http://alice-ccdb.cern.ch");
5858
ccdb->setURL("http://alice-ccdb.cern.ch");
5959
ccdb->setCaching(true);
6060
ccdb->setLocalObjectValidityChecking();
6161
}
62-
62+
6363
using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3MatchedToBCSparse>;
64-
64+
6565
void processBCs(BCsWithRun3Matchings const& bcs, aod::FV0As const&, aod::FT0s const&, aod::FDDs const&, aod::Zdcs const&, aod::Collisions const& collisions)
6666
{
6767
//+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+
@@ -70,8 +70,8 @@ struct MultiplicityExtraTable {
7070
std::vector<int> bc2multArray(bcs.size());
7171
int atIndex = 0;
7272
for (const auto& bc : bcs) {
73-
newBCindex[bc.globalIndex()]=-1;
74-
bc2multArray[bc.globalIndex()]=-1;
73+
newBCindex[bc.globalIndex()] = -1;
74+
bc2multArray[bc.globalIndex()] = -1;
7575

7676
// downscale if requested to do so
7777
if (bcDownscaleFactor < 1.f && (static_cast<float>(rand_r(&randomSeed)) / static_cast<float>(RAND_MAX)) > bcDownscaleFactor) {
@@ -91,7 +91,7 @@ struct MultiplicityExtraTable {
9191
if (multFT0C < minFT0CforBCTable) {
9292
continue; // skip this event
9393
}
94-
newBCindex[bc.globalIndex()]=atIndex++;
94+
newBCindex[bc.globalIndex()] = atIndex++;
9595
}
9696
//+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+
9797

@@ -104,7 +104,7 @@ struct MultiplicityExtraTable {
104104
//+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+
105105

106106
for (const auto& bc : bcs) {
107-
if(newBCindex[bc.globalIndex()]<0){
107+
if (newBCindex[bc.globalIndex()] < 0) {
108108
continue; // don't keep if low mult or downsampled out
109109
}
110110

@@ -115,42 +115,42 @@ struct MultiplicityExtraTable {
115115
float multFV0A = 0.f;
116116
float multFDDA = 0.f;
117117
float multFDDC = 0.f;
118-
118+
119119
// ZDC amplitudes
120120
float multZEM1 = -1.f;
121121
float multZEM2 = -1.f;
122122
float multZNA = -1.f;
123123
float multZNC = -1.f;
124124
float multZPA = -1.f;
125125
float multZPC = -1.f;
126-
126+
127127
uint8_t multFT0TriggerBits = 0;
128128
uint8_t multFV0TriggerBits = 0;
129129
uint8_t multFDDTriggerBits = 0;
130130
uint64_t multBCTriggerMask = bc.triggerMask();
131-
131+
132132
// initialize - from Arvind
133133
newRunNumber = bc.runNumber();
134134
int localBC = bc.globalBC() % nBCsPerOrbit;
135-
135+
136136
if (newRunNumber != oldRunNumber) {
137137
auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(ccdbApi, newRunNumber);
138138
auto ts = soreor.first;
139-
139+
140140
LOG(info) << " newRunNumber " << newRunNumber << " time stamp " << ts;
141141
oldRunNumber = newRunNumber;
142142
auto grplhcif = ccdb->getForTimeStamp<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", ts);
143143
CollidingBunch = grplhcif->getBunchFilling().getBCPattern();
144144
} // new run number
145-
145+
146146
bool collidingBC = CollidingBunch.test(localBC);
147-
147+
148148
if (bc.has_ft0()) {
149149
auto ft0 = bc.ft0();
150150
std::bitset<8> triggers = ft0.triggerMask();
151151
Tvx = triggers[o2::fit::Triggers::bitVertex];
152152
multFT0TriggerBits = static_cast<uint8_t>(triggers.to_ulong());
153-
153+
154154
// calculate T0 charge
155155
for (auto amplitude : ft0.amplitudeA()) {
156156
multFT0A += amplitude;
@@ -166,20 +166,20 @@ struct MultiplicityExtraTable {
166166
auto fv0 = bc.fv0a();
167167
std::bitset<8> fV0Triggers = fv0.triggerMask();
168168
multFV0TriggerBits = static_cast<uint8_t>(fV0Triggers.to_ulong());
169-
169+
170170
for (auto amplitude : fv0.amplitude()) {
171171
multFV0A += amplitude;
172172
}
173173
isFV0OrA = fV0Triggers[o2::fit::Triggers::bitA];
174174
} else {
175175
multFV0A = -999.0f;
176176
}
177-
177+
178178
if (bc.has_fdd()) {
179179
auto fdd = bc.fdd();
180180
std::bitset<8> fFDDTriggers = fdd.triggerMask();
181181
multFDDTriggerBits = static_cast<uint8_t>(fFDDTriggers.to_ulong());
182-
182+
183183
for (auto amplitude : fdd.chargeA()) {
184184
multFDDA += amplitude;
185185
}
@@ -190,7 +190,7 @@ struct MultiplicityExtraTable {
190190
multFDDA = -999.0f;
191191
multFDDC = -999.0f;
192192
}
193-
193+
194194
if (bc.has_zdc()) {
195195
multZNA = bc.zdc().amplitudeZNA();
196196
multZNC = bc.zdc().amplitudeZNC();
@@ -211,21 +211,21 @@ struct MultiplicityExtraTable {
211211
multBC(multFT0A, multFT0C, multFV0A, multFDDA, multFDDC, multZNA, multZNC, multZEM1, multZEM2, multZPA, multZPC, Tvx, isFV0OrA, multFV0TriggerBits, multFT0TriggerBits, multFDDTriggerBits, multBCTriggerMask, collidingBC);
212212
}
213213
}
214-
214+
215215
void processCollisionNeighbors(aod::Collisions const& collisions)
216216
{
217217
std::vector<float> timeArray;
218218
timeArray.resize(collisions.size(), 1e+3);
219-
219+
220220
for (const auto& collision : collisions) {
221221
timeArray[collision.globalIndex()] = collision.collisionTime();
222222
}
223-
223+
224224
float deltaPrevious = 1e+6, deltaPrePrevious = 1e+6;
225225
float deltaNext = 1e+6, deltaNeNext = 1e+6;
226226
for (const auto& collision : collisions) {
227227
int ii = collision.globalIndex();
228-
228+
229229
if (ii - 1 >= 0)
230230
deltaPrevious = timeArray[ii] - timeArray[ii - 1];
231231
if (ii - 2 >= 0)
@@ -234,11 +234,11 @@ struct MultiplicityExtraTable {
234234
deltaNext = timeArray[ii + 1] - timeArray[ii];
235235
if (ii + 2 < collisions.size())
236236
deltaNeNext = timeArray[ii + 2] - timeArray[ii];
237-
237+
238238
multNeigh(deltaPrePrevious, deltaPrevious, deltaNext, deltaNeNext);
239239
}
240240
}
241-
241+
242242
// Process switches
243243
PROCESS_SWITCH(MultiplicityExtraTable, processBCs, "Produce BC tables", true);
244244
PROCESS_SWITCH(MultiplicityExtraTable, processCollisionNeighbors, "Produce neighbor timing tables", true);

0 commit comments

Comments
 (0)