1010// or submit itself to any jurisdiction.
1111// /
1212// / \brief Filters are used to select specific rows of a table.
13- // / \author
14- // / \since
13+ // / \author Anton Alkin (anton.alkin@cern.ch)
14+ // / \file filters.cxx
1515
1616#include " Framework/runDataProcessing.h"
1717#include " Framework/AnalysisTask.h"
@@ -21,18 +21,18 @@ using namespace o2::framework;
2121using namespace o2 ::framework::expressions;
2222
2323// Apply filters on Collisions, Tracks, and TPhi
24- struct FilteringDemo {
25- Configurable<float > ptlow{ " ptlow " , 0 .5f , " " };
26- Configurable<float > ptup{ " ptup " , 2 .0f , " " };
27- Filter ptFilter_a = aod::track::pt > ptlow ;
28- Filter ptFilter_b = aod::track::pt < ptup ;
24+ struct Filters {
25+ Configurable<float > ptLow{ " ptLow " , 0 .5f , " " };
26+ Configurable<float > ptUp{ " ptUp " , 2 .0f , " " };
27+ Filter ptFilterA = aod::track::pt > ptLow ;
28+ Filter ptFilterB = aod::track::pt < ptUp ;
2929
30- Configurable<float > etalow{ " etalow " , -1 .0f , " " };
31- Configurable<float > etaup{ " etaup " , 1 .0f , " " };
32- Filter etafilter = (aod::track::eta < etaup ) && (aod::track::eta > etalow );
30+ Configurable<float > etaLow{ " etaLow " , -1 .0f , " " };
31+ Configurable<float > etaUp{ " etaUp " , 1 .0f , " " };
32+ Filter etafilter = (aod::track::eta < etaUp ) && (aod::track::eta > etaLow );
3333
34- Configurable<float > philow {" phiLow" , 1 .0f , " Phi lower limit" };
35- Configurable<float > phiup {" phiUp" , 2 .0f , " Phi upper limit" };
34+ Configurable<float > phiLow {" phiLow" , 1 .0f , " Phi lower limit" };
35+ Configurable<float > phiUp {" phiUp" , 2 .0f , " Phi upper limit" };
3636
3737 Configurable<float > vtxZ{" vtxZ" , 10 .f , " " };
3838 Filter posZfilter = nabs(aod::collision::posZ) < vtxZ;
@@ -43,7 +43,7 @@ struct FilteringDemo {
4343 // configurables can be used with ncfg(type, value, name)
4444 // where value is the default value
4545 // name is the full name in JSON, with prefix if there is any
46- Configurable<std::string> extraFilter{" extra-filter " ," (o2::aod::track::phi < ncfg(float,2.0,phiUp)) && (o2::aod::track::phi > ncfg(float,1.0,phiLow))" ," extra filter string" };
46+ Configurable<std::string> extraFilter{" extraFilter " ," (o2::aod::track::phi < ncfg(float,2.0,phiUp)) && (o2::aod::track::phi > ncfg(float,1.0,phiLow))" ," extra filter string" };
4747 Filter extraF;
4848
4949 void init (InitContext&)
@@ -59,16 +59,16 @@ struct FilteringDemo {
5959 {
6060 LOGF (info, " Collision: %d [N = %d out of %d], -%.1f < %.3f < %.1f" ,
6161 collision.globalIndex (), tracks.size (), tracks.tableSize (), (float )vtxZ, collision.posZ (), (float )vtxZ);
62- for (auto & track : tracks) {
62+ for (auto const & track : tracks) {
6363 LOGP (info, " id = {}; eta: {} < {} < {}; phi: {} < {} < {}; pt: {} < {} < {}" ,
64- track.collisionId (), (float )etalow , track.eta (), (float )etaup , (float )philow , track.phi (), (float )phiup , (float )ptlow , track.pt (), (float )ptup );
64+ track.collisionId (), (float )etaLow , track.eta (), (float )etaUp , (float )phiLow , track.phi (), (float )phiUp , (float )ptLow , track.pt (), (float )ptUp );
6565 }
6666 }
6767};
6868
6969WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
7070{
7171 return WorkflowSpec{
72- adaptAnalysisTask<FilteringDemo >(cfgc)
72+ adaptAnalysisTask<Filters >(cfgc)
7373 };
7474}
0 commit comments