@@ -135,6 +135,9 @@ enum CollisionSelectionFlags {
135135 kISVERTEXTOFMATCHEDBIT , // /< vertex contributor with TOF matched
136136 kISVERTEXTRDMATCHEDBIT , // /< vertex contributor with TRD matche
137137 kOCCUPANCYBIT , // /< occupancy within limits
138+ kISGOODITSLAYER3BIT , // /< right level of inactive chips for ITS layer 3
139+ kISGOODITSLAYER0123BIT , // /< right level of inactive chips for ITS layers 0,1,2, and 3
140+ kISGOODITSLAYERALLBIT , // /< right level of inactive chips for all seven ITS layers
138141 kCENTRALITYBIT , // /< centrality cut passed
139142 kZVERTEXBIT , // /< zvtx cut passed
140143 kSELECTED , // /< the event has passed all selections
@@ -156,6 +159,15 @@ enum TpcExclusionMethod {
156159 kDYNAMIC // /< pT dependent exclusion matching the sector borders a la Alex Dobrin
157160};
158161
162+ // / \enum ItsDeadMapsCheckType
163+ // / \brief Check for the right level of ITS dead chips
164+ enum ItsDeadMapsCheckType {
165+ kNOCHECK = 0 , // /< no check
166+ kGOODITSLAYER3 , // /< check the 3 ITS layer
167+ kGOODITSLAYER0123 , // /< check the 0,1,2,and 3 ITS layers
168+ kGOODITSLAYERALL // /< check the all ITS layers
169+ };
170+
159171// ============================================================================================
160172// The debug output stream
161173// ============================================================================================
@@ -364,7 +376,9 @@ DataType fDataType = kData;
364376CentMultEstimatorType fCentMultEstimator = kV0M ;
365377TriggerSelectionType fTriggerSelection = kMB ;
366378OccupancyEstimationType fOccupancyEstimation = kNOOCC ; /* the occupancy estimator to use */
367- float fMaxOccupancy = 1e6f; /* the maximum allowed occupancy */
379+ ItsDeadMapsCheckType fItsDeadMapCheck = kNOCHECK ; /* the check of the ITS dead maps to use */
380+
381+ float fMaxOccupancy = 1e6f; /* the maximum allowed occupancy */
368382
369383/* adaptations for the pp nightly checks */
370384analysis::CheckRangeCfg traceDCAOutliers;
@@ -524,6 +538,22 @@ inline OccupancyEstimationType getOccupancyEstimator(const std::string& estimato
524538 }
525539}
526540
541+ inline ItsDeadMapsCheckType getItsDeadMapCheck (const std::string& check)
542+ {
543+ if (check.length () == 0 || check == " None" ) {
544+ return kNOCHECK ;
545+ } else if (check == " goodIts3" ) {
546+ return kGOODITSLAYER3 ;
547+ } else if (check == " goodIts0123" ) {
548+ return kGOODITSLAYER0123 ;
549+ } else if (check == " goodItsAll" ) {
550+ return kGOODITSLAYERALL ;
551+ } else {
552+ LOGF (fatal, " ITS dead map check %s not implemented" , check.c_str ());
553+ return kNOCHECK ;
554+ }
555+ }
556+
527557// ////////////////////////////////////////////////////////////////////////////////
528558// / Trigger selection
529559// ////////////////////////////////////////////////////////////////////////////////
@@ -588,6 +618,9 @@ inline bool triggerSelectionReco(CollisionObject const& collision)
588618 flags.set (kISVERTEXITSTPCBIT , coll.selection_bit (aod::evsel::kIsVertexITSTPC ));
589619 flags.set (kISVERTEXTOFMATCHEDBIT , coll.selection_bit (aod::evsel::kIsVertexTOFmatched ));
590620 flags.set (kISVERTEXTRDMATCHEDBIT , coll.selection_bit (aod::evsel::kIsVertexTRDmatched ));
621+ flags.set (kISGOODITSLAYER3BIT , coll.selection_bit (aod::evsel::kIsGoodITSLayer3 ));
622+ flags.set (kISGOODITSLAYER0123BIT , coll.selection_bit (aod::evsel::kIsGoodITSLayer0123 ));
623+ flags.set (kISGOODITSLAYERALLBIT , coll.selection_bit (aod::evsel::kIsGoodITSLayersAll ));
591624 };
592625 switch (fTriggerSelection ) {
593626 case kMB :
@@ -880,7 +913,8 @@ inline bool centralitySelection<aod::McCollision>(aod::McCollision const&, float
880913// / Occupancy selection
881914// ////////////////////////////////////////////////////////////////////////////////
882915
883- // / \brief get the collision occupancy
916+ // / \brief select on the collision occupancy
917+ // / \return true if collison passes the occupancy cut false otherwise
884918template <typename CollisionObject>
885919inline bool selectOnOccupancy (CollisionObject collision)
886920{
@@ -924,9 +958,9 @@ inline bool occupancySelection<aod::CollisionEvSelCent>(aod::CollisionEvSelCent
924958
925959// / \brief Occupancy selection for reconstructed and detector level collision tables with Run 2 centrality/multiplicity information
926960template <>
927- inline bool occupancySelection<aod::CollisionEvSelRun2Cent>(aod::CollisionEvSelRun2Cent const & collision )
961+ inline bool occupancySelection<aod::CollisionEvSelRun2Cent>(aod::CollisionEvSelRun2Cent const &)
928962{
929- return selectOnOccupancy (collision) ;
963+ return true ;
930964}
931965
932966// / \brief Occupancy selection for reconstructed and detector level collision tables without centrality/multiplicity information
@@ -952,9 +986,9 @@ inline bool occupancySelection<soa::Join<aod::CollisionsEvSelCent, aod::McCollis
952986
953987// / \brief Occupancy selection for detector level collision tables with Run 2 centrality/multiplicity
954988template <>
955- inline bool occupancySelection<soa::Join<aod::CollisionsEvSelRun2Cent, aod::McCollisionLabels>::iterator>(soa::Join<aod::CollisionsEvSelRun2Cent, aod::McCollisionLabels>::iterator const & collision )
989+ inline bool occupancySelection<soa::Join<aod::CollisionsEvSelRun2Cent, aod::McCollisionLabels>::iterator>(soa::Join<aod::CollisionsEvSelRun2Cent, aod::McCollisionLabels>::iterator const &)
956990{
957- return selectOnOccupancy (collision) ;
991+ return true ;
958992}
959993
960994// / \brief Occupancy selection for generator level collision table
@@ -964,6 +998,98 @@ inline bool occupancySelection<aod::McCollision>(aod::McCollision const&)
964998 return true ;
965999}
9661000
1001+ // ////////////////////////////////////////////////////////////////////////////////
1002+ // / ITS dead maps selection
1003+ // ////////////////////////////////////////////////////////////////////////////////
1004+
1005+ // / \brief select on the ITS dead maps
1006+ // / \return true if the collision passes the ITS dead maps check false otherwise
1007+ template <typename CollisionObject>
1008+ inline bool selectOnItsDeadMaps (CollisionObject coll)
1009+ {
1010+ switch (fItsDeadMapCheck ) {
1011+ case kNOCHECK :
1012+ return true ;
1013+ case kGOODITSLAYER3 :
1014+ if (coll.selection_bit (aod::evsel::kIsGoodITSLayer3 )) {
1015+ return true ;
1016+ } else {
1017+ return false ;
1018+ }
1019+ case kGOODITSLAYER0123 :
1020+ if (coll.selection_bit (aod::evsel::kIsGoodITSLayer0123 )) {
1021+ return true ;
1022+ } else {
1023+ return false ;
1024+ }
1025+ case kGOODITSLAYERALL :
1026+ if (coll.selection_bit (aod::evsel::kIsGoodITSLayersAll )) {
1027+ return true ;
1028+ } else {
1029+ return false ;
1030+ }
1031+ default :
1032+ return false ;
1033+ }
1034+ }
1035+
1036+ // / \brief Occupancy selection by default: unknown subscribed collision table
1037+ template <typename CollisionObject>
1038+ inline bool itsDeadMapsSelection (CollisionObject const &)
1039+ {
1040+ LOGF (fatal, " Occupancy selection not implemented for this kind of collisions" );
1041+ return false ;
1042+ }
1043+
1044+ // / \brief Occupancy selection for reconstructed and detector level collision tables with centrality/multiplicity information
1045+ template <>
1046+ inline bool itsDeadMapsSelection<aod::CollisionEvSelCent>(aod::CollisionEvSelCent const & collision)
1047+ {
1048+ return selectOnItsDeadMaps (collision);
1049+ }
1050+
1051+ // / \brief Occupancy selection for reconstructed and detector level collision tables with Run 2 centrality/multiplicity information
1052+ template <>
1053+ inline bool itsDeadMapsSelection<aod::CollisionEvSelRun2Cent>(aod::CollisionEvSelRun2Cent const &)
1054+ {
1055+ return true ;
1056+ }
1057+
1058+ // / \brief Occupancy selection for reconstructed and detector level collision tables without centrality/multiplicity information
1059+ template <>
1060+ inline bool itsDeadMapsSelection<aod::CollisionEvSel>(aod::CollisionEvSel const & collision)
1061+ {
1062+ return selectOnItsDeadMaps (collision);
1063+ }
1064+
1065+ // / \brief Occupancy selection for detector level collision tables without centrality/multiplicity
1066+ template <>
1067+ inline bool itsDeadMapsSelection<soa::Join<aod::CollisionsEvSel, aod::McCollisionLabels>::iterator>(soa::Join<aod::CollisionsEvSel, aod::McCollisionLabels>::iterator const & collision)
1068+ {
1069+ return selectOnItsDeadMaps (collision);
1070+ }
1071+
1072+ // / \brief Occupancy selection for detector level collision tables with centrality/multiplicity
1073+ template <>
1074+ inline bool itsDeadMapsSelection<soa::Join<aod::CollisionsEvSelCent, aod::McCollisionLabels>::iterator>(soa::Join<aod::CollisionsEvSelCent, aod::McCollisionLabels>::iterator const & collision)
1075+ {
1076+ return selectOnItsDeadMaps (collision);
1077+ }
1078+
1079+ // / \brief Occupancy selection for detector level collision tables with Run 2 centrality/multiplicity
1080+ template <>
1081+ inline bool itsDeadMapsSelection<soa::Join<aod::CollisionsEvSelRun2Cent, aod::McCollisionLabels>::iterator>(soa::Join<aod::CollisionsEvSelRun2Cent, aod::McCollisionLabels>::iterator const &)
1082+ {
1083+ return true ;
1084+ }
1085+
1086+ // / \brief Occupancy selection for generator level collision table
1087+ template <>
1088+ inline bool itsDeadMapsSelection<aod::McCollision>(aod::McCollision const &)
1089+ {
1090+ return true ;
1091+ }
1092+
9671093// ////////////////////////////////////////////////////////////////////////////////
9681094// / Event selection
9691095// ////////////////////////////////////////////////////////////////////////////////
@@ -978,6 +1104,8 @@ inline bool isEventSelected(CollisionObject const& collision, float& centormult)
9781104
9791105 bool occupancysel = occupancySelection (collision);
9801106
1107+ bool itsdeadmapssel = itsDeadMapsSelection (collision);
1108+
9811109 bool zvtxsel = false ;
9821110 /* TODO: vertex quality checks */
9831111 if (zvtxlow < collision.posZ () && collision.posZ () < zvtxup) {
@@ -995,7 +1123,7 @@ inline bool isEventSelected(CollisionObject const& collision, float& centormult)
9951123
9961124 bool centmultsel = centralitySelection (collision, centormult);
9971125
998- bool accepted = trigsel && occupancysel && zvtxsel && centmultsel;
1126+ bool accepted = trigsel && occupancysel && itsdeadmapssel && zvtxsel && centmultsel;
9991127
10001128 if (accepted) {
10011129 collisionFlags.set (kSELECTED );
0 commit comments