diff --git a/DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTShower.h b/DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTShower.h
index 1bb0277b34a8..00de2566b256 100644
--- a/DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTShower.h
+++ b/DataFormats/L1DTTrackFinder/interface/L1Phase2MuDTShower.h
@@ -10,7 +10,7 @@
 //    Federica Primavera  Bologna INFN
 //    Carlos Vico  Oviedo Spain,
 //    Daniel Estrada Acevedo Oviedo Spain.
-//    
+//
 //
 //--------------------------------------------------
 #ifndef L1Phase2MuDTShower_H
@@ -38,24 +38,23 @@ public:
   //  Constructors
   L1Phase2MuDTShower();
 
-  L1Phase2MuDTShower(int wh,  // Wheel
-                     int sc,  // Sector
-                     int st,  // Station
-                     int sl,  // Superlayer
-                     int ndigis, // Number of digis within shower
-                     int bx,  // BX estimation
-                     int min_wire, // Minimum wire
-                     int max_wire, // Maximum wire
-                     float avg_pos, // Averaged position of the shower
-                     float avg_time, // Averaged time of the shower
-                     const std::vector<int> wires_profile // Wires profile
-                    ); 
- 
+  L1Phase2MuDTShower(int wh,                               // Wheel
+                     int sc,                               // Sector
+                     int st,                               // Station
+                     int sl,                               // Superlayer
+                     int ndigis,                           // Number of digis within shower
+                     int bx,                               // BX estimation
+                     int min_wire,                         // Minimum wire
+                     int max_wire,                         // Maximum wire
+                     float avg_pos,                        // Averaged position of the shower
+                     float avg_time,                       // Averaged time of the shower
+                     const std::vector<int> wires_profile  // Wires profile
+  );
 
-  virtual ~L1Phase2MuDTShower(){};
+  virtual ~L1Phase2MuDTShower() {};
 
   // Operations
-  
+
   int whNum() const;
   int scNum() const;
   int stNum() const;
@@ -69,7 +68,6 @@ public:
   std::vector<int> wiresProfile() const;
 
 private:
-  
   int m_wheel;
   int m_sector;
   int m_station;
diff --git a/DataFormats/L1DTTrackFinder/src/L1Phase2MuDTShower.cc b/DataFormats/L1DTTrackFinder/src/L1Phase2MuDTShower.cc
index 6b23c86ddf72..68219e545702 100644
--- a/DataFormats/L1DTTrackFinder/src/L1Phase2MuDTShower.cc
+++ b/DataFormats/L1DTTrackFinder/src/L1Phase2MuDTShower.cc
@@ -45,22 +45,31 @@ L1Phase2MuDTShower::L1Phase2MuDTShower()
       m_max_wire(0),
       m_avg_pos(0),
       m_avg_time(0) {
-    m_wires_profile.resize(96, 0);
-      }
-
-L1Phase2MuDTShower::L1Phase2MuDTShower(
-  int wh, int sc, int st, int sl, int ndigis, int bx, int min_wire, int max_wire, float avg_pos, float avg_time, const std::vector<int> wires_profile)
-  : m_wheel(wh),
-    m_sector(sc),
-    m_station(st),
-    m_superlayer(sl),
-    m_ndigis(ndigis),
-    m_bx(bx),
-    m_min_wire(min_wire),
-    m_max_wire(max_wire),
-    m_avg_pos(avg_pos),
-    m_avg_time(avg_time),
-    m_wires_profile(wires_profile) {}
+  m_wires_profile.resize(96, 0);
+}
+
+L1Phase2MuDTShower::L1Phase2MuDTShower(int wh,
+                                       int sc,
+                                       int st,
+                                       int sl,
+                                       int ndigis,
+                                       int bx,
+                                       int min_wire,
+                                       int max_wire,
+                                       float avg_pos,
+                                       float avg_time,
+                                       const std::vector<int> wires_profile)
+    : m_wheel(wh),
+      m_sector(sc),
+      m_station(st),
+      m_superlayer(sl),
+      m_ndigis(ndigis),
+      m_bx(bx),
+      m_min_wire(min_wire),
+      m_max_wire(max_wire),
+      m_avg_pos(avg_pos),
+      m_avg_time(avg_time),
+      m_wires_profile(wires_profile) {}
 
 //--------------
 // Operations --
diff --git a/DataFormats/L1DTTrackFinder/src/L1Phase2MuDTShowerContainer.cc b/DataFormats/L1DTTrackFinder/src/L1Phase2MuDTShowerContainer.cc
index 3ac836edf44a..5cc6723b91d3 100644
--- a/DataFormats/L1DTTrackFinder/src/L1Phase2MuDTShowerContainer.cc
+++ b/DataFormats/L1DTTrackFinder/src/L1Phase2MuDTShowerContainer.cc
@@ -38,4 +38,6 @@ L1Phase2MuDTShowerContainer::L1Phase2MuDTShowerContainer() {}
 //--------------
 void L1Phase2MuDTShowerContainer::setContainer(const Shower_Container& inputShowers) { m_showers = inputShowers; }
 
-L1Phase2MuDTShowerContainer::Shower_Container const* L1Phase2MuDTShowerContainer::getContainer() const { return &m_showers; }
+L1Phase2MuDTShowerContainer::Shower_Container const* L1Phase2MuDTShowerContainer::getContainer() const {
+  return &m_showers;
+}
diff --git a/L1Trigger/DTTriggerPhase2/interface/MPCoincidenceFilter.h b/L1Trigger/DTTriggerPhase2/interface/MPCoincidenceFilter.h
index a863a32b73ed..c360b8385032 100644
--- a/L1Trigger/DTTriggerPhase2/interface/MPCoincidenceFilter.h
+++ b/L1Trigger/DTTriggerPhase2/interface/MPCoincidenceFilter.h
@@ -72,7 +72,7 @@ private:
                                            std::vector<cmsdt::metaPrimitive> allMPs,
                                            int co_option,
                                            int co_quality,
-					   int co_wh2option,
+                                           int co_wh2option,
                                            double shift_back);
 
   // Private attributes
diff --git a/L1Trigger/DTTriggerPhase2/interface/MPThetaMatching.h b/L1Trigger/DTTriggerPhase2/interface/MPThetaMatching.h
index c43d2a03be32..9d4d36070ae0 100644
--- a/L1Trigger/DTTriggerPhase2/interface/MPThetaMatching.h
+++ b/L1Trigger/DTTriggerPhase2/interface/MPThetaMatching.h
@@ -30,11 +30,11 @@ public:
            const edm::EventSetup &iEventSetup,
            std::vector<cmsdt::metaPrimitive> &allMPaths,
            std::vector<cmsdt::metaPrimitive> &inMPaths,
-           std::vector<cmsdt::metaPrimitive> &outMPaths) override{};
+           std::vector<cmsdt::metaPrimitive> &outMPaths) override {};
   void run(edm::Event &iEvent,
            const edm::EventSetup &iEventSetup,
            MuonPathPtrs &inMPath,
-           MuonPathPtrs &outMPath) override{};
+           MuonPathPtrs &outMPath) override {};
 
   void finish() override;
 
diff --git a/L1Trigger/DTTriggerPhase2/interface/ShowerBuilder.h b/L1Trigger/DTTriggerPhase2/interface/ShowerBuilder.h
index 930e0191827f..3bbb70e23897 100644
--- a/L1Trigger/DTTriggerPhase2/interface/ShowerBuilder.h
+++ b/L1Trigger/DTTriggerPhase2/interface/ShowerBuilder.h
@@ -23,153 +23,158 @@
 // ===============================================================================
 
 namespace showerb {
-    typedef std::pair<int, DTPrimitive> DTPrimPlusBx;
-    typedef std::deque<DTPrimPlusBx> ShowerBuffer;
-    
-    inline bool hitWireSort_shower(const DTPrimitive& hit1, const DTPrimitive& hit2){
-        int wi1 = hit1.channelId();
-        int wi2 = hit2.channelId();
-
-        if (wi1 < wi2) return true;
-        else return false;
+  typedef std::pair<int, DTPrimitive> DTPrimPlusBx;
+  typedef std::deque<DTPrimPlusBx> ShowerBuffer;
+
+  inline bool hitWireSort_shower(const DTPrimitive& hit1, const DTPrimitive& hit2) {
+    int wi1 = hit1.channelId();
+    int wi2 = hit2.channelId();
+
+    if (wi1 < wi2)
+      return true;
+    else
+      return false;
+  }
+
+  inline bool hitLayerSort_shower(const DTPrimitive& hit1, const DTPrimitive& hit2) {
+    int lay1 = hit1.layerId();
+    int lay2 = hit2.layerId();
+
+    if (lay1 < lay2)
+      return true;
+    else if (lay1 > lay2)
+      return false;
+    else
+      return hitWireSort_shower(hit1, hit2);
+  }
+
+  inline bool hitTimeSort_shower(const DTPrimitive& hit1, const DTPrimitive& hit2) {
+    int tdc1 = hit1.tdcTimeStamp();
+    int tdc2 = hit2.tdcTimeStamp();
+
+    if (tdc1 < tdc2)
+      return true;
+    else
+      return false;
+    // else if (tdc1 > tdc2) return false;
+    // else return hitLayerSort_shower(hit1, hit2); --> ignoring those sortings for now
+  }
+
+  inline float compute_avg_pos(DTPrimitives& hits) {
+    int nhits_ = hits.size();
+
+    if (nhits_ == 0)
+      return -1.0;
+
+    float aux_avgPos_ = 0;
+
+    for (auto& hit : hits) {
+      aux_avgPos_ += hit.wireHorizPos();
     }
 
-    inline bool hitLayerSort_shower(const DTPrimitive& hit1, const DTPrimitive& hit2) {
-        int lay1 = hit1.layerId();
-        int lay2 = hit2.layerId();
+    return aux_avgPos_ / nhits_;
+  }
 
-        if (lay1 < lay2) return true;
-        else if (lay1 > lay2) return false;
-        else return hitWireSort_shower(hit1, hit2);
-    }
+  inline float compute_avg_time(DTPrimitives& hits) {
+    int nhits_ = hits.size();
 
-    inline bool hitTimeSort_shower(const DTPrimitive& hit1, const DTPrimitive& hit2) {
-        int tdc1 = hit1.tdcTimeStamp();
-        int tdc2 = hit2.tdcTimeStamp();
+    if (nhits_ == 0)
+      return -1.0;
 
-        if (tdc1 < tdc2) return true;
-        else return false;
-        // else if (tdc1 > tdc2) return false;
-        // else return hitLayerSort_shower(hit1, hit2); --> ignoring those sortings for now
-    }
+    float aux_avgTime_ = 0;
 
-    inline float compute_avg_pos(DTPrimitives& hits) { 
-        int nhits_ = hits.size();
-        
-        if (nhits_ == 0) return -1.0;
-        
-        float aux_avgPos_ = 0;
-        
-        for (auto& hit : hits) {
-            aux_avgPos_ += hit.wireHorizPos();
-        }
-        
-        return aux_avgPos_ / nhits_;
-    }
-    
-    inline float compute_avg_time(DTPrimitives& hits) {
-        int nhits_ = hits.size();
-
-        if (nhits_ == 0) return -1.0;
-
-        float aux_avgTime_ = 0;
-        
-        for (auto& hit : hits) {
-            aux_avgTime_ += hit.tdcTimeStamp();
-        }
-        return aux_avgTime_ / nhits_;
+    for (auto& hit : hits) {
+      aux_avgTime_ += hit.tdcTimeStamp();
     }
+    return aux_avgTime_ / nhits_;
+  }
 
-    inline void set_wires_profile(std::vector<int>& wires_profile, DTPrimitives& hits) {
-        for (auto& hit : hits) {
-            wires_profile[hit.channelId()-1]++;
-        }
+  inline void set_wires_profile(std::vector<int>& wires_profile, DTPrimitives& hits) {
+    for (auto& hit : hits) {
+      wires_profile[hit.channelId() - 1]++;
     }
+  }
 
-    inline bool buffer_contains(const ShowerBuffer& buffer, const DTPrimitive& hit) {
-        for (const auto& item : buffer) {
-            if (item.second.channelId() == hit.channelId()) return true;
-        }
-        return false;
+  inline bool buffer_contains(const ShowerBuffer& buffer, const DTPrimitive& hit) {
+    for (const auto& item : buffer) {
+      if (item.second.channelId() == hit.channelId())
+        return true;
     }
+    return false;
+  }
 
-    inline void buffer_get_hits(const ShowerBuffer& buffer, DTPrimitives& hits) {
-        for (const auto& item : buffer) {
-            hits.push_back(item.second);
-        }
+  inline void buffer_get_hits(const ShowerBuffer& buffer, DTPrimitives& hits) {
+    for (const auto& item : buffer) {
+      hits.push_back(item.second);
     }
+  }
 
-    inline void buffer_clear_olds(ShowerBuffer& buffer, const int _current_bx, const int persistence_bx_units) {
-        while (!buffer.empty() && (_current_bx - buffer.front().first) > persistence_bx_units) {
-            buffer.pop_front();
-        }
+  inline void buffer_clear_olds(ShowerBuffer& buffer, const int _current_bx, const int persistence_bx_units) {
+    while (!buffer.empty() && (_current_bx - buffer.front().first) > persistence_bx_units) {
+      buffer.pop_front();
     }
+  }
 
-    inline void buffer_reset(ShowerBuffer& buffer) {
-        buffer.clear();
-    }
-}
+  inline void buffer_reset(ShowerBuffer& buffer) { buffer.clear(); }
+}  // namespace showerb
 
 // ===============================================================================
 // Class declarations
 // ===============================================================================
 
 class ShowerBuilder {
-
 public:
-    // Constructors and destructor
-    ShowerBuilder(const edm::ParameterSet& pset, edm::ConsumesCollector& iC);
-    virtual ~ShowerBuilder();
-
-    // Main methods
-    virtual void initialise(const edm::EventSetup& iEventSetup);
-    virtual void run(edm::Event& iEvent,
-                     const edm::EventSetup& iEventSetup,
-                     const DTDigiCollection& digis,
-                     ShowerCandidatePtr &showerCandidate_SL1,
-                     ShowerCandidatePtr &showerCandidate_SL3);
-    virtual void finish();
+  // Constructors and destructor
+  ShowerBuilder(const edm::ParameterSet& pset, edm::ConsumesCollector& iC);
+  virtual ~ShowerBuilder();
+
+  // Main methods
+  virtual void initialise(const edm::EventSetup& iEventSetup);
+  virtual void run(edm::Event& iEvent,
+                   const edm::EventSetup& iEventSetup,
+                   const DTDigiCollection& digis,
+                   ShowerCandidatePtr& showerCandidate_SL1,
+                   ShowerCandidatePtr& showerCandidate_SL3);
+  virtual void finish();
 
 private:
-    // Private auxiliary methods
-    void clear();
-    void setInChannels(const DTDigiCollection* digi);
-    void processHits_standAlone(std::map<int, ShowerCandidatePtr> &showerCands);
-    void processHitsFirmwareEmulation(std::map<int, ShowerCandidatePtr> &showerCands);
-
-    bool triggerShower(const showerb::ShowerBuffer& buffer);
-    void set_shower_properties(
-        ShowerCandidatePtr &showerCand,
-        showerb::ShowerBuffer& buffer, 
-        int nhits = -1,
-        int bx = -1,
-        int min_wire = -1,
-        int max_wire = -1,
-        float avg_pos = -1.,
-        float avg_time = -1.
-    );
-    void groupHits_byBx();
-    void fill_obdt(const int bx);
-    void fill_bmtl1_buffers();
-    void bxStep(const int _current_bx);
-
-    // Private attributes
-    const int showerTaggingAlgo_;
-    const int threshold_for_shower_;
-    const int nHits_per_bx_;
-    const int obdt_hits_bxpersistence_;
-    const int obdt_wire_relaxing_time_;
-    const int bmtl1_hits_bxpersistence_;
-    const bool debug_;
-    const int scenario_;
-
-    // auxiliary variables
-    DTPrimitives all_hits;
-    std::map<int, DTPrimitives, std::less<int>> all_hits_perBx;
-    showerb::ShowerBuffer obdt_buffer; // Buffer to emulate the OBDT behavior
-    showerb::ShowerBuffer hot_wires_buffer; // Buffer to emulate the hot wires behavior
-    showerb::ShowerBuffer bmtl1_sl1_buffer; // Buffer to emulate the BMTL1 shower buffer for SL1
-    showerb::ShowerBuffer bmtl1_sl3_buffer; // Buffer to emulate the BMTL1 shower buffer for SL3
+  // Private auxiliary methods
+  void clear();
+  void setInChannels(const DTDigiCollection* digi);
+  void processHits_standAlone(std::map<int, ShowerCandidatePtr>& showerCands);
+  void processHitsFirmwareEmulation(std::map<int, ShowerCandidatePtr>& showerCands);
+
+  bool triggerShower(const showerb::ShowerBuffer& buffer);
+  void set_shower_properties(ShowerCandidatePtr& showerCand,
+                             showerb::ShowerBuffer& buffer,
+                             int nhits = -1,
+                             int bx = -1,
+                             int min_wire = -1,
+                             int max_wire = -1,
+                             float avg_pos = -1.,
+                             float avg_time = -1.);
+  void groupHits_byBx();
+  void fill_obdt(const int bx);
+  void fill_bmtl1_buffers();
+  void bxStep(const int _current_bx);
+
+  // Private attributes
+  const int showerTaggingAlgo_;
+  const int threshold_for_shower_;
+  const int nHits_per_bx_;
+  const int obdt_hits_bxpersistence_;
+  const int obdt_wire_relaxing_time_;
+  const int bmtl1_hits_bxpersistence_;
+  const bool debug_;
+  const int scenario_;
+
+  // auxiliary variables
+  DTPrimitives all_hits;
+  std::map<int, DTPrimitives, std::less<int>> all_hits_perBx;
+  showerb::ShowerBuffer obdt_buffer;       // Buffer to emulate the OBDT behavior
+  showerb::ShowerBuffer hot_wires_buffer;  // Buffer to emulate the hot wires behavior
+  showerb::ShowerBuffer bmtl1_sl1_buffer;  // Buffer to emulate the BMTL1 shower buffer for SL1
+  showerb::ShowerBuffer bmtl1_sl3_buffer;  // Buffer to emulate the BMTL1 shower buffer for SL3
 };
 
 #endif
diff --git a/L1Trigger/DTTriggerPhase2/interface/ShowerCandidate.h b/L1Trigger/DTTriggerPhase2/interface/ShowerCandidate.h
index ac030c5c0d84..3c553bca6e49 100644
--- a/L1Trigger/DTTriggerPhase2/interface/ShowerCandidate.h
+++ b/L1Trigger/DTTriggerPhase2/interface/ShowerCandidate.h
@@ -8,49 +8,49 @@
 
 class ShowerCandidate {
 public:
-    ShowerCandidate();
-
-    ShowerCandidate& operator=(const ShowerCandidate &other);
-
-    virtual ~ShowerCandidate() {}
-
-    // setter methods
-    void rawId(int rawId) { rawId_ = rawId;}
-    void setBX(int bx) {bx_ = bx;}
-    void setNhits(int nhits) {nhits_ = nhits;}
-    void setMinWire(int wmin) {wmin_ = wmin;}
-    void setMaxWire(int wmax) {wmax_ = wmax;}
-    void setAvgPos(float avgPos) {avgPos_ = avgPos;}
-    void setAvgTime(float avgTime) {avgTime_ = avgTime;}
-    void flag() {shower_flag_ = true;}
-    
-    // getters methods
-    int getRawId() {return rawId_;}
-    int getBX() {return bx_;}
-    int getNhits() { return nhits_; }
-    int getMinWire() {return wmin_;}
-    int getMaxWire() {return wmax_;}
-    float getAvgPos() {return avgPos_;}
-    float getAvgTime() {return avgTime_;}
-    std::vector<int>& getWiresProfile() { return wires_profile_; }
-    bool isFlagged() {return shower_flag_;}
-    
-    // Other methods
-    void clear();
+  ShowerCandidate();
+
+  ShowerCandidate& operator=(const ShowerCandidate& other);
+
+  virtual ~ShowerCandidate() {}
+
+  // setter methods
+  void rawId(int rawId) { rawId_ = rawId; }
+  void setBX(int bx) { bx_ = bx; }
+  void setNhits(int nhits) { nhits_ = nhits; }
+  void setMinWire(int wmin) { wmin_ = wmin; }
+  void setMaxWire(int wmax) { wmax_ = wmax; }
+  void setAvgPos(float avgPos) { avgPos_ = avgPos; }
+  void setAvgTime(float avgTime) { avgTime_ = avgTime; }
+  void flag() { shower_flag_ = true; }
+
+  // getters methods
+  int getRawId() { return rawId_; }
+  int getBX() { return bx_; }
+  int getNhits() { return nhits_; }
+  int getMinWire() { return wmin_; }
+  int getMaxWire() { return wmax_; }
+  float getAvgPos() { return avgPos_; }
+  float getAvgTime() { return avgTime_; }
+  std::vector<int>& getWiresProfile() { return wires_profile_; }
+  bool isFlagged() { return shower_flag_; }
+
+  // Other methods
+  void clear();
 
 private:
-    //------------------------------------------------------------------
-    //---  ShowerCandidate's data
-    //------------------------------------------------------------------
-    int nhits_;
-    int rawId_;
-    int bx_;
-    int wmin_;
-    int wmax_;
-    bool shower_flag_;
-    float avgPos_;
-    float avgTime_;
-    std::vector<int> wires_profile_;
+  //------------------------------------------------------------------
+  //---  ShowerCandidate's data
+  //------------------------------------------------------------------
+  int nhits_;
+  int rawId_;
+  int bx_;
+  int wmin_;
+  int wmax_;
+  bool shower_flag_;
+  float avgPos_;
+  float avgTime_;
+  std::vector<int> wires_profile_;
 };
 
 typedef std::vector<ShowerCandidate> ShowerCandidates;
diff --git a/L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2Prod.cc b/L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2Prod.cc
index 571aa28b311d..b73da113e123 100644
--- a/L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2Prod.cc
+++ b/L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2Prod.cc
@@ -865,7 +865,7 @@ void DTTrigPhase2Prod::produce(Event& iEvent, const EventSetup& iEventSetup) {
     }
   }
 
-  //for (auto& ch_filtcoMetaPrimitives : coMetaPrimitives) 
+  //for (auto& ch_filtcoMetaPrimitives : coMetaPrimitives)
   //cout<<"coMetaPrimitives: "<<coMetaPrimitives[ch_filtcoMetaPrimitives.first].size()<<endl;
 
   allMetaPrimitives.clear();
@@ -888,7 +888,8 @@ void DTTrigPhase2Prod::produce(Event& iEvent, const EventSetup& iEventSetup) {
   }
 
   for (auto& mych : coMetaPrimitives)
-  cout<<"coMetaPrimitives: "<<coMetaPrimitives[mych.first].size() <<" thMatchedMetaPrimitives: " << thMatchedMetaPrimitives[mych.first].size() <<endl;
+    cout << "coMetaPrimitives: " << coMetaPrimitives[mych.first].size()
+         << " thMatchedMetaPrimitives: " << thMatchedMetaPrimitives[mych.first].size() << endl;
 
   /////////////
 
diff --git a/L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2ShowerProd.cc b/L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2ShowerProd.cc
index 5456053ae149..e7459e2b573f 100644
--- a/L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2ShowerProd.cc
+++ b/L1Trigger/DTTriggerPhase2/plugins/DTTrigPhase2ShowerProd.cc
@@ -55,199 +55,204 @@ using namespace std;
 using namespace cmsdt;
 
 class DTTrigPhase2ShowerProd : public edm::stream::EDProducer<> {
-    /* Declaration of the plugin */
-
-    // Types
-    typedef std::map<DTChamberId, DTDigiCollection, std::less<DTChamberId>> DTDigiMap;
-    typedef DTDigiMap::iterator DTDigiMap_iterator;
-    typedef DTDigiMap::const_iterator DTDigiMap_const_iterator;
-
-    public:
-        // Public methods/attributes
-        
-        //! Constructor
-        DTTrigPhase2ShowerProd(const edm::ParameterSet& pset);
-
-        //! Destructor
-        ~DTTrigPhase2ShowerProd() override;
-
-        //! Create Trigger Units before starting event processing
-        void beginRun(edm::Run const& iRun, const edm::EventSetup& iEventSetup) override;
-
-        //! Producer: process every event and generates trigger data
-        void produce(edm::Event& iEvent, const edm::EventSetup& iEventSetup) override;
-
-        //! endRun: finish things
-        void endRun(edm::Run const& iRun, const edm::EventSetup& iEventSetup) override;
-
-        static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
-    
-        // Members
-        const DTGeometry* dtGeo_;
-        edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomH;
-
-    private:
-        // Private methods/attributes
-        bool debug_; // Debug flag
-        int showerTaggingAlgo_; // Shower tagging algorithm
-        edm::InputTag digiTag_; // Digi collection label
-        edm::EDGetTokenT<DTDigiCollection> dtDigisToken_; // Digi container
-        std::unique_ptr<ShowerBuilder> showerBuilder; // Shower builder instance      
-};
+  /* Declaration of the plugin */
 
-/* Implementation of the plugin */
-DTTrigPhase2ShowerProd::DTTrigPhase2ShowerProd(const ParameterSet& pset) {
-    // Constructor implementation
-    produces<L1Phase2MuDTShowerContainer>();
-    // Unpack information from pset
-    debug_ = pset.getUntrackedParameter<bool>("debug");
-    digiTag_ = pset.getParameter<edm::InputTag>("digiTag");
-    showerTaggingAlgo_ = pset.getParameter<int>("showerTaggingAlgo");
-
-    // Fetch consumes
-    dtDigisToken_ = consumes<DTDigiCollection>(digiTag_);
-
-    // Algorithm functionalities
-    edm::ConsumesCollector consumesColl(consumesCollector());
-    showerBuilder = std::make_unique<ShowerBuilder>(pset, consumesColl);
-
-    // Load geometry
-    dtGeomH = esConsumes<DTGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
-
-    if (debug_) {
-        LogDebug("DTTrigPhase2ShowerProd") << "DTTrigPhase2ShowerProd: constructor" << endl;
-        if (showerTaggingAlgo_ == 0) {
-            LogDebug("DTTrigPhase2ShowerProd") << "Using standalone mode" << endl;
-        }
-        else if (showerTaggingAlgo_ == 1) {
-            LogDebug("DTTrigPhase2ShowerProd") << "Using firmware emulation mode" << endl;
-        }
-        else LogError("DTTrigPhase2ShowerProd") << "Unrecognized shower tagging algorithm" << endl;
-    }
-}
+  // Types
+  typedef std::map<DTChamberId, DTDigiCollection, std::less<DTChamberId>> DTDigiMap;
+  typedef DTDigiMap::iterator DTDigiMap_iterator;
+  typedef DTDigiMap::const_iterator DTDigiMap_const_iterator;
 
-DTTrigPhase2ShowerProd::~DTTrigPhase2ShowerProd() {
-    // Destructor implementation
-    if (debug_) LogDebug("DTTrigPhase2ShowerProd") << "DTTrigPhase2ShowerProd: destructor" << endl;
-}
+public:
+  // Public methods/attributes
 
-void DTTrigPhase2ShowerProd::beginRun(edm::Run const& iRun, const edm::EventSetup& iEventSetup) {
-    // beginRun implementation
-    if (debug_) LogDebug("DTTrigPhase2ShowerProd") << "DTTrigPhase2ShowerProd: beginRun started" << endl;
+  //! Constructor
+  DTTrigPhase2ShowerProd(const edm::ParameterSet& pset);
 
-    showerBuilder->initialise(iEventSetup);
-    if (auto geom = iEventSetup.getHandle(dtGeomH)) {
-        dtGeo_ = &(*geom);
-    }
-}
+  //! Destructor
+  ~DTTrigPhase2ShowerProd() override;
 
-void DTTrigPhase2ShowerProd::produce(edm::Event& iEvent, const edm::EventSetup& iEventSetup) {
-    // produce implementation
-    if (debug_) LogDebug("DTTrigPhase2ShowerProd") << "DTTrigPhase2ShowerProd: produce Processing event" << endl;
-
-    // Fetch the handle for hits
-    edm::Handle<DTDigiCollection> dtdigis;
-    iEvent.getByToken(dtDigisToken_, dtdigis);
-
-    // 1. Preprocessing: store digi information by chamber
-    DTDigiMap digiMap;
-    DTDigiCollection::DigiRangeIterator detUnitIt;
-    if (debug_) LogDebug("DTTrigPhase2ShowerProd") << "    Preprocessing hits..." << endl;
-
-    for (const auto& detUnitIt : *dtdigis) {
-        const DTLayerId& layId = detUnitIt.first;
-        const DTChamberId chambId = layId.superlayerId().chamberId();
-        const DTDigiCollection::Range& digi_range = detUnitIt.second; // This is the digi collection
-        digiMap[chambId].put(digi_range, layId);
-    }
-    
-    if (debug_) LogDebug("DTTrigPhase2ShowerProd") << "    Hits preprocessed: " << digiMap.size() 
-        << " DT chambers to analyze" << endl;
+  //! Create Trigger Units before starting event processing
+  void beginRun(edm::Run const& iRun, const edm::EventSetup& iEventSetup) override;
 
-    // 2. Look for showers in each chamber
-    if (debug_) LogDebug("DTTrigPhase2ShowerProd") << "    Building shower candidates for:" << endl; 
+  //! Producer: process every event and generates trigger data
+  void produce(edm::Event& iEvent, const edm::EventSetup& iEventSetup) override;
 
-    std::map<DTSuperLayerId, ShowerCandidatePtr> ShowerCandidates;
-    for (const auto& ich : dtGeo_->chambers()) {
-        const DTChamber* chamb = ich;
-        DTChamberId chid = chamb->id();
-        DTDigiMap_iterator dmit = digiMap.find(chid);
+  //! endRun: finish things
+  void endRun(edm::Run const& iRun, const edm::EventSetup& iEventSetup) override;
 
-        DTSuperLayerId sl1id = chamb -> superLayer(1) -> id();
-        DTSuperLayerId sl3id = chamb -> superLayer(3) -> id();
+  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
 
-        if (dmit == digiMap.end())
-            continue;
+  // Members
+  const DTGeometry* dtGeo_;
+  edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomH;
 
-        if (debug_) LogDebug("DTTrigPhase2ShowerProd") << "      " << chid << endl;
+private:
+  // Private methods/attributes
+  bool debug_;                                       // Debug flag
+  int showerTaggingAlgo_;                            // Shower tagging algorithm
+  edm::InputTag digiTag_;                            // Digi collection label
+  edm::EDGetTokenT<DTDigiCollection> dtDigisToken_;  // Digi container
+  std::unique_ptr<ShowerBuilder> showerBuilder;      // Shower builder instance
+};
 
-        showerBuilder->run(iEvent, iEventSetup, (*dmit).second, ShowerCandidates[sl1id], ShowerCandidates[sl3id]);
+/* Implementation of the plugin */
+DTTrigPhase2ShowerProd::DTTrigPhase2ShowerProd(const ParameterSet& pset) {
+  // Constructor implementation
+  produces<L1Phase2MuDTShowerContainer>();
+  // Unpack information from pset
+  debug_ = pset.getUntrackedParameter<bool>("debug");
+  digiTag_ = pset.getParameter<edm::InputTag>("digiTag");
+  showerTaggingAlgo_ = pset.getParameter<int>("showerTaggingAlgo");
+
+  // Fetch consumes
+  dtDigisToken_ = consumes<DTDigiCollection>(digiTag_);
+
+  // Algorithm functionalities
+  edm::ConsumesCollector consumesColl(consumesCollector());
+  showerBuilder = std::make_unique<ShowerBuilder>(pset, consumesColl);
+
+  // Load geometry
+  dtGeomH = esConsumes<DTGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
+
+  if (debug_) {
+    LogDebug("DTTrigPhase2ShowerProd") << "DTTrigPhase2ShowerProd: constructor" << endl;
+    if (showerTaggingAlgo_ == 0) {
+      LogDebug("DTTrigPhase2ShowerProd") << "Using standalone mode" << endl;
+    } else if (showerTaggingAlgo_ == 1) {
+      LogDebug("DTTrigPhase2ShowerProd") << "Using firmware emulation mode" << endl;
+    } else
+      LogError("DTTrigPhase2ShowerProd") << "Unrecognized shower tagging algorithm" << endl;
+  }
+}
 
-        // Save the rawId of these shower candidates
-        ShowerCandidates[sl1id]->rawId(sl1id.rawId());
-        ShowerCandidates[sl3id]->rawId(sl3id.rawId());
-    }
+DTTrigPhase2ShowerProd::~DTTrigPhase2ShowerProd() {
+  // Destructor implementation
+  if (debug_)
+    LogDebug("DTTrigPhase2ShowerProd") << "DTTrigPhase2ShowerProd: destructor" << endl;
+}
 
-    // 3. Check shower candidates and store them if flagged
-    if (debug_) LogDebug("DTTrigPhase2ShowerProd") << "    Selecting shower candidates" << endl;
-
-    std::vector<L1Phase2MuDTShower> outShower; // prepare output container
-    for (auto& sl_showerCand : ShowerCandidates) {
-        auto showerCandIt = sl_showerCand.second;
-        
-        if (showerCandIt->isFlagged()) {
-            DTSuperLayerId slId(showerCandIt->getRawId());
-
-            if (debug_) {
-                LogDebug("DTTrigPhase2ShowerProd") << "      Shower candidate tagged in chamber"
-                << slId.chamberId() << ", SL" << slId.superlayer();
-            }
-            // 4. Storing results
-            outShower.emplace_back(
-                L1Phase2MuDTShower(
-                    slId.wheel(), // Wheel
-                    slId.sector(), // Sector 
-                    slId.station(), // Station
-                    slId.superlayer(), // SuperLayer 
-                    showerCandIt->getNhits(), // number of digis
-                    showerCandIt->getBX(), // BX
-                    showerCandIt->getMinWire(), // Min wire
-                    showerCandIt->getMaxWire(), // Max wire
-                    showerCandIt->getAvgPos(), // Average position
-                    showerCandIt->getAvgTime(), // Average time
-                    showerCandIt->getWiresProfile() // Wires profile
-                )
-            ); 
-        }
-    }
-    if (debug_) LogDebug("DTTrigPhase2ShowerProd") << "    Storing results..." << endl;
+void DTTrigPhase2ShowerProd::beginRun(edm::Run const& iRun, const edm::EventSetup& iEventSetup) {
+  // beginRun implementation
+  if (debug_)
+    LogDebug("DTTrigPhase2ShowerProd") << "DTTrigPhase2ShowerProd: beginRun started" << endl;
+
+  showerBuilder->initialise(iEventSetup);
+  if (auto geom = iEventSetup.getHandle(dtGeomH)) {
+    dtGeo_ = &(*geom);
+  }
+}
 
-    // 4.1 Storing results
-    std::unique_ptr<L1Phase2MuDTShowerContainer> resultShower(new L1Phase2MuDTShowerContainer);
-    resultShower->setContainer(outShower);
-    iEvent.put(std::move(resultShower));
+void DTTrigPhase2ShowerProd::produce(edm::Event& iEvent, const edm::EventSetup& iEventSetup) {
+  // produce implementation
+  if (debug_)
+    LogDebug("DTTrigPhase2ShowerProd") << "DTTrigPhase2ShowerProd: produce Processing event" << endl;
+
+  // Fetch the handle for hits
+  edm::Handle<DTDigiCollection> dtdigis;
+  iEvent.getByToken(dtDigisToken_, dtdigis);
+
+  // 1. Preprocessing: store digi information by chamber
+  DTDigiMap digiMap;
+  DTDigiCollection::DigiRangeIterator detUnitIt;
+  if (debug_)
+    LogDebug("DTTrigPhase2ShowerProd") << "    Preprocessing hits..." << endl;
+
+  for (const auto& detUnitIt : *dtdigis) {
+    const DTLayerId& layId = detUnitIt.first;
+    const DTChamberId chambId = layId.superlayerId().chamberId();
+    const DTDigiCollection::Range& digi_range = detUnitIt.second;  // This is the digi collection
+    digiMap[chambId].put(digi_range, layId);
+  }
+
+  if (debug_)
+    LogDebug("DTTrigPhase2ShowerProd") << "    Hits preprocessed: " << digiMap.size() << " DT chambers to analyze"
+                                       << endl;
+
+  // 2. Look for showers in each chamber
+  if (debug_)
+    LogDebug("DTTrigPhase2ShowerProd") << "    Building shower candidates for:" << endl;
+
+  std::map<DTSuperLayerId, ShowerCandidatePtr> ShowerCandidates;
+  for (const auto& ich : dtGeo_->chambers()) {
+    const DTChamber* chamb = ich;
+    DTChamberId chid = chamb->id();
+    DTDigiMap_iterator dmit = digiMap.find(chid);
+
+    DTSuperLayerId sl1id = chamb->superLayer(1)->id();
+    DTSuperLayerId sl3id = chamb->superLayer(3)->id();
+
+    if (dmit == digiMap.end())
+      continue;
+
+    if (debug_)
+      LogDebug("DTTrigPhase2ShowerProd") << "      " << chid << endl;
+
+    showerBuilder->run(iEvent, iEventSetup, (*dmit).second, ShowerCandidates[sl1id], ShowerCandidates[sl3id]);
+
+    // Save the rawId of these shower candidates
+    ShowerCandidates[sl1id]->rawId(sl1id.rawId());
+    ShowerCandidates[sl3id]->rawId(sl3id.rawId());
+  }
+
+  // 3. Check shower candidates and store them if flagged
+  if (debug_)
+    LogDebug("DTTrigPhase2ShowerProd") << "    Selecting shower candidates" << endl;
+
+  std::vector<L1Phase2MuDTShower> outShower;  // prepare output container
+  for (auto& sl_showerCand : ShowerCandidates) {
+    auto showerCandIt = sl_showerCand.second;
+
+    if (showerCandIt->isFlagged()) {
+      DTSuperLayerId slId(showerCandIt->getRawId());
+
+      if (debug_) {
+        LogDebug("DTTrigPhase2ShowerProd")
+            << "      Shower candidate tagged in chamber" << slId.chamberId() << ", SL" << slId.superlayer();
+      }
+      // 4. Storing results
+      outShower.emplace_back(L1Phase2MuDTShower(slId.wheel(),                    // Wheel
+                                                slId.sector(),                   // Sector
+                                                slId.station(),                  // Station
+                                                slId.superlayer(),               // SuperLayer
+                                                showerCandIt->getNhits(),        // number of digis
+                                                showerCandIt->getBX(),           // BX
+                                                showerCandIt->getMinWire(),      // Min wire
+                                                showerCandIt->getMaxWire(),      // Max wire
+                                                showerCandIt->getAvgPos(),       // Average position
+                                                showerCandIt->getAvgTime(),      // Average time
+                                                showerCandIt->getWiresProfile()  // Wires profile
+                                                ));
+    }
+  }
+  if (debug_)
+    LogDebug("DTTrigPhase2ShowerProd") << "    Storing results..." << endl;
+
+  // 4.1 Storing results
+  std::unique_ptr<L1Phase2MuDTShowerContainer> resultShower(new L1Phase2MuDTShowerContainer);
+  resultShower->setContainer(outShower);
+  iEvent.put(std::move(resultShower));
 }
 
 void DTTrigPhase2ShowerProd::endRun(edm::Run const& iRun, const edm::EventSetup& iEventSetup) {
-    // endRun implementation
-    if (debug_) LogDebug("DTTrigPhase2ShowerProd") << "DTTrigPhase2ShowerProd: endRun" << endl;
+  // endRun implementation
+  if (debug_)
+    LogDebug("DTTrigPhase2ShowerProd") << "DTTrigPhase2ShowerProd: endRun" << endl;
 }
 
 void DTTrigPhase2ShowerProd::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
-    // dtTriggerPhase2Shower
-    edm::ParameterSetDescription desc;
-    desc.add<edm::InputTag>("digiTag", edm::InputTag("CalibratedDigis"));
-    desc.add<int>("showerTaggingAlgo", 1);
-    desc.add<int>("threshold_for_shower", 6);
-    desc.add<int>("nHits_per_bx", 8);
-    desc.add<int>("obdt_hits_bxpersistence", 4);
-    desc.add<int>("obdt_wire_relaxing_time", 2);
-    desc.add<int>("bmtl1_hits_bxpersistence", 16);
-    desc.add<int>("scenario", 0);
-    desc.addUntracked<bool>("debug", false);
-
-    descriptions.add("dtTriggerPhase2Shower", desc);
+  // dtTriggerPhase2Shower
+  edm::ParameterSetDescription desc;
+  desc.add<edm::InputTag>("digiTag", edm::InputTag("CalibratedDigis"));
+  desc.add<int>("showerTaggingAlgo", 1);
+  desc.add<int>("threshold_for_shower", 6);
+  desc.add<int>("nHits_per_bx", 8);
+  desc.add<int>("obdt_hits_bxpersistence", 4);
+  desc.add<int>("obdt_wire_relaxing_time", 2);
+  desc.add<int>("bmtl1_hits_bxpersistence", 16);
+  desc.add<int>("scenario", 0);
+  desc.addUntracked<bool>("debug", false);
+
+  descriptions.add("dtTriggerPhase2Shower", desc);
 }
 
-
 DEFINE_FWK_MODULE(DTTrigPhase2ShowerProd);
diff --git a/L1Trigger/DTTriggerPhase2/src/MPCoincidenceFilter.cc b/L1Trigger/DTTriggerPhase2/src/MPCoincidenceFilter.cc
index e76d7876ba37..cb998d8ffacf 100644
--- a/L1Trigger/DTTriggerPhase2/src/MPCoincidenceFilter.cc
+++ b/L1Trigger/DTTriggerPhase2/src/MPCoincidenceFilter.cc
@@ -73,10 +73,12 @@ std::vector<metaPrimitive> MPCoincidenceFilter::filter(std::vector<metaPrimitive
       sector = 10;
 
     bool wh2pass = false;
-    if(abs(wheel)==2 && station==1 && co_wh2option==1)wh2pass=true;
-    if(abs(wheel)==2 && station<3  && co_wh2option==2)wh2pass=true;
+    if (abs(wheel) == 2 && station == 1 && co_wh2option == 1)
+      wh2pass = true;
+    if (abs(wheel) == 2 && station < 3 && co_wh2option == 2)
+      wh2pass = true;
 
-    if (co_option == -1 || mp.quality > 5 || wh2pass==1)
+    if (co_option == -1 || mp.quality > 5 || wh2pass == 1)
       outMPs.push_back(mp);
     else {
       int sector_p1 = sector + 1;
diff --git a/L1Trigger/DTTriggerPhase2/src/MPThetaMatching.cc b/L1Trigger/DTTriggerPhase2/src/MPThetaMatching.cc
index acaac1e0fbc2..eab8aea0a0c0 100644
--- a/L1Trigger/DTTriggerPhase2/src/MPThetaMatching.cc
+++ b/L1Trigger/DTTriggerPhase2/src/MPThetaMatching.cc
@@ -79,7 +79,7 @@ void MPThetaMatching::run(edm::Event &iEvent,
   }
 }
 
-void MPThetaMatching::finish(){};
+void MPThetaMatching::finish() {};
 
 ///////////////////////////
 ///  OTHER METHODS
@@ -272,7 +272,7 @@ std::vector<metaPrimitive> MPThetaMatching::getBestThetaMPInChamber(std::vector<
       }
       if (nTPs == 1 && !saved)
         bestThetaMPs.push_back(mp1);  //only one Theta TP in chamber and it is q=1
-    }                                 //wheel ==0
+    }  //wheel ==0
 
     else
       bestThetaMPs.push_back(mp1);
diff --git a/L1Trigger/DTTriggerPhase2/src/ShowerBuilder.cc b/L1Trigger/DTTriggerPhase2/src/ShowerBuilder.cc
index 5f5b5046b59f..7d7150a7deb0 100644
--- a/L1Trigger/DTTriggerPhase2/src/ShowerBuilder.cc
+++ b/L1Trigger/DTTriggerPhase2/src/ShowerBuilder.cc
@@ -9,288 +9,285 @@ using namespace cmsdt;
 // ============================================================================
 // Constructors and destructor
 // ============================================================================
-ShowerBuilder::ShowerBuilder(const ParameterSet& pset, edm::ConsumesCollector& iC) :
-    // Unpack information from pset
-    showerTaggingAlgo_(pset.getParameter<int>("showerTaggingAlgo")), 
-    threshold_for_shower_(pset.getParameter<int>("threshold_for_shower")), 
-    nHits_per_bx_(pset.getParameter<int>("nHits_per_bx")), 
-    obdt_hits_bxpersistence_(pset.getParameter<int>("obdt_hits_bxpersistence")),
-    obdt_wire_relaxing_time_(pset.getParameter<int>("obdt_wire_relaxing_time")),
-    bmtl1_hits_bxpersistence_(pset.getParameter<int>("bmtl1_hits_bxpersistence")),
-    debug_(pset.getUntrackedParameter<bool>("debug")),
-    scenario_(pset.getParameter<int>("scenario")) {
-}
+ShowerBuilder::ShowerBuilder(const ParameterSet &pset, edm::ConsumesCollector &iC)
+    :  // Unpack information from pset
+      showerTaggingAlgo_(pset.getParameter<int>("showerTaggingAlgo")),
+      threshold_for_shower_(pset.getParameter<int>("threshold_for_shower")),
+      nHits_per_bx_(pset.getParameter<int>("nHits_per_bx")),
+      obdt_hits_bxpersistence_(pset.getParameter<int>("obdt_hits_bxpersistence")),
+      obdt_wire_relaxing_time_(pset.getParameter<int>("obdt_wire_relaxing_time")),
+      bmtl1_hits_bxpersistence_(pset.getParameter<int>("bmtl1_hits_bxpersistence")),
+      debug_(pset.getUntrackedParameter<bool>("debug")),
+      scenario_(pset.getParameter<int>("scenario")) {}
 
 ShowerBuilder::~ShowerBuilder() {}
 
 // ============================================================================
 // Main methods (initialise, run, finish)
 // ============================================================================
-void ShowerBuilder::initialise(const edm::EventSetup& iEventSetup) {}
+void ShowerBuilder::initialise(const edm::EventSetup &iEventSetup) {}
 
-void ShowerBuilder::run(Event& iEvent,
-                        const EventSetup& iEventSetup,
-                        const DTDigiCollection& digis,
+void ShowerBuilder::run(Event &iEvent,
+                        const EventSetup &iEventSetup,
+                        const DTDigiCollection &digis,
                         ShowerCandidatePtr &showerCandidate_SL1,
                         ShowerCandidatePtr &showerCandidate_SL3) {
-    // Clear auxiliars
-    clear();
-    // Set the incoming hits in the channels
-    setInChannels(&digis);
-    
-    std::map<int, ShowerCandidatePtr> aux_showerCands{ // defined as a map to easy acces with SL number
-        {1, make_shared<ShowerCandidate>()},
-        {3, make_shared<ShowerCandidate>()}
-    };
-
-    int nHits = all_hits.size();
-    if  (nHits != 0) {
-        if (debug_) LogDebug("ShowerBuilder") << "        - Going to study " << nHits << " hits";
-        if (showerTaggingAlgo_ == 0) {
-            // Standalone mode: just save hits and flag if the number of hits is above the threshold
-            processHits_standAlone(aux_showerCands);
-        }
-        else if (showerTaggingAlgo_ == 1) {
-            // Firmware emulation: 
-            // mimics the behavior of sending and receiving hits from the OBDT to the shower algorithm in the BMTL1.
-            processHitsFirmwareEmulation(aux_showerCands);
-        }
-    }
-    else {
-        if (debug_) LogDebug("ShowerBuilder") << "        - No hits to study.";
+  // Clear auxiliars
+  clear();
+  // Set the incoming hits in the channels
+  setInChannels(&digis);
+
+  std::map<int, ShowerCandidatePtr> aux_showerCands{// defined as a map to easy acces with SL number
+                                                    {1, make_shared<ShowerCandidate>()},
+                                                    {3, make_shared<ShowerCandidate>()}};
+
+  int nHits = all_hits.size();
+  if (nHits != 0) {
+    if (debug_)
+      LogDebug("ShowerBuilder") << "        - Going to study " << nHits << " hits";
+    if (showerTaggingAlgo_ == 0) {
+      // Standalone mode: just save hits and flag if the number of hits is above the threshold
+      processHits_standAlone(aux_showerCands);
+    } else if (showerTaggingAlgo_ == 1) {
+      // Firmware emulation:
+      // mimics the behavior of sending and receiving hits from the OBDT to the shower algorithm in the BMTL1.
+      processHitsFirmwareEmulation(aux_showerCands);
     }
+  } else {
+    if (debug_)
+      LogDebug("ShowerBuilder") << "        - No hits to study.";
+  }
 
-    showerCandidate_SL1 = std::move(aux_showerCands[1]);
-    showerCandidate_SL3 = std::move(aux_showerCands[3]);
+  showerCandidate_SL1 = std::move(aux_showerCands[1]);
+  showerCandidate_SL3 = std::move(aux_showerCands[3]);
 }
 
-void ShowerBuilder::finish(){};
+void ShowerBuilder::finish() {};
 
 // ============================================================================
 // Auxiliary methods
 // ============================================================================
-void ShowerBuilder::clear(){
-    all_hits.clear();
-    all_hits_perBx.clear();
-    showerb::buffer_reset(obdt_buffer);
-    showerb::buffer_reset(hot_wires_buffer);
-    showerb::buffer_reset(bmtl1_sl1_buffer);
-    showerb::buffer_reset(bmtl1_sl3_buffer);
+void ShowerBuilder::clear() {
+  all_hits.clear();
+  all_hits_perBx.clear();
+  showerb::buffer_reset(obdt_buffer);
+  showerb::buffer_reset(hot_wires_buffer);
+  showerb::buffer_reset(bmtl1_sl1_buffer);
+  showerb::buffer_reset(bmtl1_sl3_buffer);
 }
 
 void ShowerBuilder::setInChannels(const DTDigiCollection *digis) {
-    for (const auto &dtLayerId_It : *digis) {
-        const DTLayerId id = dtLayerId_It.first;
-        if (id.superlayer() == 2) continue; // Skip SL2 digis
-        // Now iterate over the digis
-        for (DTDigiCollection::const_iterator digiIt = (dtLayerId_It.second).first; 
-             digiIt != (dtLayerId_It.second).second; ++digiIt) {
-            auto dtpAux = DTPrimitive();
-            dtpAux.setTDCTimeStamp((*digiIt).time());
-            dtpAux.setChannelId((*digiIt).wire());
-            dtpAux.setLayerId(id.layer());
-            dtpAux.setSuperLayerId(id.superlayer());
-            dtpAux.setCameraId(id.rawId());
-            all_hits.push_back(dtpAux);
-        }
+  for (const auto &dtLayerId_It : *digis) {
+    const DTLayerId id = dtLayerId_It.first;
+    if (id.superlayer() == 2)
+      continue;  // Skip SL2 digis
+    // Now iterate over the digis
+    for (DTDigiCollection::const_iterator digiIt = (dtLayerId_It.second).first; digiIt != (dtLayerId_It.second).second;
+         ++digiIt) {
+      auto dtpAux = DTPrimitive();
+      dtpAux.setTDCTimeStamp((*digiIt).time());
+      dtpAux.setChannelId((*digiIt).wire());
+      dtpAux.setLayerId(id.layer());
+      dtpAux.setSuperLayerId(id.superlayer());
+      dtpAux.setCameraId(id.rawId());
+      all_hits.push_back(dtpAux);
     }
-    // sort the hits by time
-    std::stable_sort(all_hits.begin(), all_hits.end(), showerb::hitTimeSort_shower);
+  }
+  // sort the hits by time
+  std::stable_sort(all_hits.begin(), all_hits.end(), showerb::hitTimeSort_shower);
 }
 
 void ShowerBuilder::processHits_standAlone(std::map<int, ShowerCandidatePtr> &showerCands) {
-    // For each superlayer, fill the buffer and check if nHits >= threshold
-    for (auto &hit : all_hits) {
-        showerb::DTPrimPlusBx _hitpbx(-1, hit);
-        if (hit.superLayerId() == 1) bmtl1_sl1_buffer.push_back(_hitpbx);
-        else if (hit.superLayerId() == 3) bmtl1_sl3_buffer.push_back(_hitpbx);   
+  // For each superlayer, fill the buffer and check if nHits >= threshold
+  for (auto &hit : all_hits) {
+    showerb::DTPrimPlusBx _hitpbx(-1, hit);
+    if (hit.superLayerId() == 1)
+      bmtl1_sl1_buffer.push_back(_hitpbx);
+    else if (hit.superLayerId() == 3)
+      bmtl1_sl3_buffer.push_back(_hitpbx);
+  }
+
+  if (triggerShower(bmtl1_sl1_buffer)) {
+    if (debug_) {
+      int nHits_sl1 = bmtl1_sl1_buffer.size();
+      LogDebug("ShowerBuilder") << "        o Shower found in SL1 with " << nHits_sl1 << " hits";
+    }
+    showerCands[1]->flag();
+    set_shower_properties(showerCands[1], bmtl1_sl1_buffer);
+  }
+  if (triggerShower(bmtl1_sl3_buffer)) {
+    if (debug_) {
+      int nHits_sl3 = bmtl1_sl3_buffer.size();
+      LogDebug("ShowerBuilder") << "        o Shower found in SL3 with " << nHits_sl3 << " hits";
     }
+    showerCands[3]->flag();
+    set_shower_properties(showerCands[3], bmtl1_sl3_buffer);
+  }
+}
 
+void ShowerBuilder::processHitsFirmwareEmulation(std::map<int, ShowerCandidatePtr> &showerCands) {
+  // Use a for over BXs to emulate the behavior of the OBDT and BMTL1, this means considering:
+  // 1. OBDT can only store recived hits during 4 BXs (adjustable with obdt_hits_bxpersistence_)
+  // 2. OBDT can recive hits from the same wire during 2 BXs (adjustable with obdt_wire_relaxing_time_)
+  // 3. OBDT can only sends 8 hits per BX to the BMTL1 (adjustable with obdt_hits_per_bx_)
+  // 4. Shower algorithm in the BMTL1 mantains the hits along 16 BXs and triggers if nHits >= threshold (adjustable with bmtl1_hits_bxpersistence_)
+  groupHits_byBx();
+
+  // auxiliary variables
+  int prev_nHits_sl1 = 0;
+  int nHits_sl1 = 0;
+  bool shower_sl1_already_set = false;
+  int prev_nHits_sl3 = 0;
+  int nHits_sl3 = 0;
+  bool shower_sl3_already_set = false;
+  // -------------------
+
+  int min_bx = all_hits_perBx.begin()->first;
+  int max_bx = all_hits_perBx.rbegin()->first;
+
+  if (debug_)
+    LogDebug("ShowerBuilder") << "        - bx range: " << min_bx << " - " << max_bx << ", size: " << (max_bx - min_bx);
+
+  for (int bx = min_bx; bx <= max_bx + 17; bx++) {
+    fill_obdt(bx);
+
+    if (debug_)
+      LogDebug("ShowerBuilder") << "          ^ " << obdt_buffer.size() << " hits in obdt_buffer at BX " << bx;
+    fill_bmtl1_buffers();
+
+    nHits_sl1 = bmtl1_sl1_buffer.size();
+    if (debug_)
+      LogDebug("ShowerBuilder") << "          ^ " << nHits_sl1 << " hits in bmtl1_sl1_buffer at BX " << bx;
+    nHits_sl3 = bmtl1_sl3_buffer.size();
+    if (debug_)
+      LogDebug("ShowerBuilder") << "          ^ " << nHits_sl3 << " hits in bmtl1_sl3_buffer at BX " << bx;
     if (triggerShower(bmtl1_sl1_buffer)) {
-        if (debug_) {
-            int nHits_sl1 = bmtl1_sl1_buffer.size();
-            LogDebug("ShowerBuilder") << "        o Shower found in SL1 with " << nHits_sl1 << " hits";
-        }
-        showerCands[1]->flag();
-        set_shower_properties(showerCands[1], bmtl1_sl1_buffer);
+      if (debug_ && !showerCands[1]->isFlagged()) {
+        LogDebug("ShowerBuilder") << "        o Shower found in SL1 with " << nHits_sl1 << " hits";
+      }
+      showerCands[1]->flag();
     }
     if (triggerShower(bmtl1_sl3_buffer)) {
-        if (debug_) {
-            int nHits_sl3 = bmtl1_sl3_buffer.size();
-            LogDebug("ShowerBuilder") << "        o Shower found in SL3 with " << nHits_sl3 << " hits";
-        }
-        showerCands[3]->flag();
-        set_shower_properties(showerCands[3], bmtl1_sl3_buffer);
+      if (debug_ && !showerCands[3]->isFlagged()) {
+        LogDebug("ShowerBuilder") << "        o Shower found in SL3 with " << nHits_sl3 << " hits";
+      }
+      showerCands[3]->flag();
     }
-}
 
-void ShowerBuilder::processHitsFirmwareEmulation(std::map<int, ShowerCandidatePtr> &showerCands) {
-    // Use a for over BXs to emulate the behavior of the OBDT and BMTL1, this means considering:
-    // 1. OBDT can only store recived hits during 4 BXs (adjustable with obdt_hits_bxpersistence_)
-    // 2. OBDT can recive hits from the same wire during 2 BXs (adjustable with obdt_wire_relaxing_time_)
-    // 3. OBDT can only sends 8 hits per BX to the BMTL1 (adjustable with obdt_hits_per_bx_)
-    // 4. Shower algorithm in the BMTL1 mantains the hits along 16 BXs and triggers if nHits >= threshold (adjustable with bmtl1_hits_bxpersistence_)
-    groupHits_byBx();
-
-    // auxiliary variables
-    int prev_nHits_sl1 = 0;
-    int nHits_sl1 = 0;
-    bool shower_sl1_already_set = false;
-    int prev_nHits_sl3 = 0;
-    int nHits_sl3 = 0;
-    bool shower_sl3_already_set = false;
-    // -------------------
-
-    int min_bx = all_hits_perBx.begin()->first;
-    int max_bx = all_hits_perBx.rbegin()->first;
-
-    if (debug_) LogDebug("ShowerBuilder") << "        - bx range: " << min_bx << " - " << max_bx 
-                                          << ", size: "<< (max_bx-min_bx);
-    
-    for (int bx = min_bx; bx <= max_bx + 17; bx++) {
-        fill_obdt(bx);
-        
-        if (debug_) LogDebug("ShowerBuilder") << "          ^ " << obdt_buffer.size() 
-                                              << " hits in obdt_buffer at BX " << bx;
-        fill_bmtl1_buffers();
-        
-        nHits_sl1 = bmtl1_sl1_buffer.size();
-        if (debug_) LogDebug("ShowerBuilder") << "          ^ " << nHits_sl1 
-                                              << " hits in bmtl1_sl1_buffer at BX " << bx;
-        nHits_sl3 = bmtl1_sl3_buffer.size();
-        if (debug_) LogDebug("ShowerBuilder") << "          ^ " << nHits_sl3 
-                                              << " hits in bmtl1_sl3_buffer at BX " << bx;    
-        if (triggerShower(bmtl1_sl1_buffer)) {
-            if (debug_ && !showerCands[1]->isFlagged()) {
-                LogDebug("ShowerBuilder") << "        o Shower found in SL1 with " << nHits_sl1 << " hits";
-            }
-            showerCands[1]->flag();
-        }
-        if (triggerShower(bmtl1_sl3_buffer)) {
-            if (debug_ && !showerCands[3]->isFlagged()) {
-                LogDebug("ShowerBuilder") << "        o Shower found in SL3 with " << nHits_sl3 << " hits";
-            }
-            showerCands[3]->flag();
-        }
-
-        if (nHits_sl1 < prev_nHits_sl1 && showerCands[1]->isFlagged() && !shower_sl1_already_set) {
-            shower_sl1_already_set = true;
-            set_shower_properties(showerCands[1], bmtl1_sl1_buffer, nHits_sl1, bx);
-        } else {
-            prev_nHits_sl1 = nHits_sl1;
-        }
-
-        if (nHits_sl3 < prev_nHits_sl3 && showerCands[3]->isFlagged() && !shower_sl3_already_set) {
-            shower_sl3_already_set = true;
-            set_shower_properties(showerCands[3], bmtl1_sl3_buffer, nHits_sl3, bx);
-        } else {
-            prev_nHits_sl3 = nHits_sl3;
-        }
-
-        bxStep(bx);
+    if (nHits_sl1 < prev_nHits_sl1 && showerCands[1]->isFlagged() && !shower_sl1_already_set) {
+      shower_sl1_already_set = true;
+      set_shower_properties(showerCands[1], bmtl1_sl1_buffer, nHits_sl1, bx);
+    } else {
+      prev_nHits_sl1 = nHits_sl1;
     }
-}
 
-bool ShowerBuilder::triggerShower(const showerb::ShowerBuffer& buffer) {
-    int nHits = buffer.size();
-    if (nHits >= threshold_for_shower_) {
-        return true;
+    if (nHits_sl3 < prev_nHits_sl3 && showerCands[3]->isFlagged() && !shower_sl3_already_set) {
+      shower_sl3_already_set = true;
+      set_shower_properties(showerCands[3], bmtl1_sl3_buffer, nHits_sl3, bx);
+    } else {
+      prev_nHits_sl3 = nHits_sl3;
     }
-    return false;
+
+    bxStep(bx);
+  }
 }
 
-void ShowerBuilder::set_shower_properties(
-    ShowerCandidatePtr &showerCand,
-    showerb::ShowerBuffer& buffer, 
-    int nhits, 
-    int bx, 
-    int min_wire, 
-    int max_wire, 
-    float avg_pos, 
-    float avg_time
-    ) {
-    DTPrimitives _hits;
-
-    showerb::buffer_get_hits(buffer, _hits);
-    std::stable_sort(_hits.begin(), _hits.end(), showerb::hitWireSort_shower);
-
-    // change values considering the buffer or the input values
-    nhits = (nhits == -1) ? _hits.size() : nhits;
-    min_wire = (min_wire == -1) ? _hits.front().channelId() : min_wire;
-    max_wire = (max_wire == -1) ? _hits.back().channelId() : max_wire;
-    avg_pos = (avg_pos == -1) ? showerb::compute_avg_pos(_hits) : avg_pos;
-    avg_time = (avg_time == -1) ? showerb::compute_avg_time(_hits) : avg_time;
-
-    showerCand->setNhits(nhits);
-    showerCand->setBX(bx);
-    showerCand->setMinWire(min_wire);
-    showerCand->setMaxWire(max_wire);
-    showerCand->setAvgPos(avg_pos);
-    showerCand->setAvgTime(avg_time);
-    showerb::set_wires_profile(showerCand->getWiresProfile(), _hits);
+bool ShowerBuilder::triggerShower(const showerb::ShowerBuffer &buffer) {
+  int nHits = buffer.size();
+  if (nHits >= threshold_for_shower_) {
+    return true;
+  }
+  return false;
+}
+
+void ShowerBuilder::set_shower_properties(ShowerCandidatePtr &showerCand,
+                                          showerb::ShowerBuffer &buffer,
+                                          int nhits,
+                                          int bx,
+                                          int min_wire,
+                                          int max_wire,
+                                          float avg_pos,
+                                          float avg_time) {
+  DTPrimitives _hits;
+
+  showerb::buffer_get_hits(buffer, _hits);
+  std::stable_sort(_hits.begin(), _hits.end(), showerb::hitWireSort_shower);
+
+  // change values considering the buffer or the input values
+  nhits = (nhits == -1) ? _hits.size() : nhits;
+  min_wire = (min_wire == -1) ? _hits.front().channelId() : min_wire;
+  max_wire = (max_wire == -1) ? _hits.back().channelId() : max_wire;
+  avg_pos = (avg_pos == -1) ? showerb::compute_avg_pos(_hits) : avg_pos;
+  avg_time = (avg_time == -1) ? showerb::compute_avg_time(_hits) : avg_time;
+
+  showerCand->setNhits(nhits);
+  showerCand->setBX(bx);
+  showerCand->setMinWire(min_wire);
+  showerCand->setMaxWire(max_wire);
+  showerCand->setAvgPos(avg_pos);
+  showerCand->setAvgTime(avg_time);
+  showerb::set_wires_profile(showerCand->getWiresProfile(), _hits);
 }
 
 void ShowerBuilder::groupHits_byBx() {
-    double shift_back = 0;
-    if (scenario_ == MC)  //scope for MC
-        shift_back = 400;
-    else if (scenario_ == DATA)  //scope for data
-        shift_back = 0;
-    else if (scenario_ == SLICE_TEST)  //scope for slice test
-        shift_back = 400;
-
-    all_hits_perBx.clear();
-    // Group hits by BX
-    for (auto &hit : all_hits) {
-        // Compute the BX from the TDC time
-        int bx = hit.tdcTimeStamp() / 25 - shift_back;
-        all_hits_perBx[bx].push_back(hit);
-    }
+  double shift_back = 0;
+  if (scenario_ == MC)  //scope for MC
+    shift_back = 400;
+  else if (scenario_ == DATA)  //scope for data
+    shift_back = 0;
+  else if (scenario_ == SLICE_TEST)  //scope for slice test
+    shift_back = 400;
+
+  all_hits_perBx.clear();
+  // Group hits by BX
+  for (auto &hit : all_hits) {
+    // Compute the BX from the TDC time
+    int bx = hit.tdcTimeStamp() / 25 - shift_back;
+    all_hits_perBx[bx].push_back(hit);
+  }
 }
 
 void ShowerBuilder::fill_obdt(const int bx) {
-    // Fill the OBDT buffer with the hits in the current BX this function ensure that hot wires are not added
-    if (all_hits_perBx.find(bx) != all_hits_perBx.end()) {
-        for (auto &hit : all_hits_perBx[bx]) {
-      
-            if (debug_) LogDebug("ShowerBuilder") << "          ^ Trying to add hit with wire " 
-                                                  << hit.channelId() << " in OBDT at BX " << bx;
-            if (!showerb::buffer_contains(hot_wires_buffer, hit)) {
-                if (debug_) LogDebug("ShowerBuilder") << "          ^ added";
-                showerb::DTPrimPlusBx _hit(bx, hit);
-                obdt_buffer.push_back(_hit);
-                hot_wires_buffer.push_back(_hit);
-            }
-        }
+  // Fill the OBDT buffer with the hits in the current BX this function ensure that hot wires are not added
+  if (all_hits_perBx.find(bx) != all_hits_perBx.end()) {
+    for (auto &hit : all_hits_perBx[bx]) {
+      if (debug_)
+        LogDebug("ShowerBuilder") << "          ^ Trying to add hit with wire " << hit.channelId() << " in OBDT at BX "
+                                  << bx;
+      if (!showerb::buffer_contains(hot_wires_buffer, hit)) {
+        if (debug_)
+          LogDebug("ShowerBuilder") << "          ^ added";
+        showerb::DTPrimPlusBx _hit(bx, hit);
+        obdt_buffer.push_back(_hit);
+        hot_wires_buffer.push_back(_hit);
+      }
     }
-}    
-
-void ShowerBuilder::fill_bmtl1_buffers(){
-    // Fill the BMTL1 buffer with the hits in the OBDT buffer only nHits_per_bx_ hits are added
-    if (obdt_buffer.empty()) return;
-    if (debug_) LogDebug("ShowerBuilder") << "          ^ Getting hits from OBDT";
-    for (int i = 0; i < nHits_per_bx_; i++) {
-        if (obdt_buffer.empty()) break;
-        auto _hitpbx = obdt_buffer.front();
-        if (_hitpbx.second.superLayerId() == 1) {
-            bmtl1_sl1_buffer.push_back(_hitpbx);
-        }
-        else if (_hitpbx.second.superLayerId() == 3) {
-            bmtl1_sl3_buffer.push_back(_hitpbx);
-        }
-        obdt_buffer.pop_front();
+  }
+}
+
+void ShowerBuilder::fill_bmtl1_buffers() {
+  // Fill the BMTL1 buffer with the hits in the OBDT buffer only nHits_per_bx_ hits are added
+  if (obdt_buffer.empty())
+    return;
+  if (debug_)
+    LogDebug("ShowerBuilder") << "          ^ Getting hits from OBDT";
+  for (int i = 0; i < nHits_per_bx_; i++) {
+    if (obdt_buffer.empty())
+      break;
+    auto _hitpbx = obdt_buffer.front();
+    if (_hitpbx.second.superLayerId() == 1) {
+      bmtl1_sl1_buffer.push_back(_hitpbx);
+    } else if (_hitpbx.second.superLayerId() == 3) {
+      bmtl1_sl3_buffer.push_back(_hitpbx);
     }
+    obdt_buffer.pop_front();
+  }
 }
 
 void ShowerBuilder::bxStep(const int _current_bx) {
-    // Remove old elements from the buffers
-    showerb::buffer_clear_olds(obdt_buffer, _current_bx, obdt_hits_bxpersistence_);
-    showerb::buffer_clear_olds(hot_wires_buffer, _current_bx, obdt_hits_bxpersistence_);
-    showerb::buffer_clear_olds(bmtl1_sl1_buffer, _current_bx, bmtl1_hits_bxpersistence_);
-    showerb::buffer_clear_olds(bmtl1_sl3_buffer, _current_bx, bmtl1_hits_bxpersistence_);
+  // Remove old elements from the buffers
+  showerb::buffer_clear_olds(obdt_buffer, _current_bx, obdt_hits_bxpersistence_);
+  showerb::buffer_clear_olds(hot_wires_buffer, _current_bx, obdt_hits_bxpersistence_);
+  showerb::buffer_clear_olds(bmtl1_sl1_buffer, _current_bx, bmtl1_hits_bxpersistence_);
+  showerb::buffer_clear_olds(bmtl1_sl3_buffer, _current_bx, bmtl1_hits_bxpersistence_);
 }
-
-
-
-
-
diff --git a/L1Trigger/DTTriggerPhase2/src/ShowerCandidate.cc b/L1Trigger/DTTriggerPhase2/src/ShowerCandidate.cc
index 87cf72c72f4c..77580c09937b 100644
--- a/L1Trigger/DTTriggerPhase2/src/ShowerCandidate.cc
+++ b/L1Trigger/DTTriggerPhase2/src/ShowerCandidate.cc
@@ -6,31 +6,29 @@
 
 using namespace cmsdt;
 
-ShowerCandidate::ShowerCandidate() {
-    clear();
-}
+ShowerCandidate::ShowerCandidate() { clear(); }
 
-ShowerCandidate& ShowerCandidate::operator=(const ShowerCandidate &other) {
-    if (this != &other) {
-        nhits_ = other.nhits_;
-        rawId_ = other.rawId_;
-        bx_ = other.bx_;
-        wmin_ = other.wmin_;
-        wmax_ = other.wmax_;
-        avgPos_ = other.avgPos_;
-        avgTime_ = other.avgTime_;
-        shower_flag_ = other.shower_flag_;
-    }
-    return *this;
+ShowerCandidate& ShowerCandidate::operator=(const ShowerCandidate& other) {
+  if (this != &other) {
+    nhits_ = other.nhits_;
+    rawId_ = other.rawId_;
+    bx_ = other.bx_;
+    wmin_ = other.wmin_;
+    wmax_ = other.wmax_;
+    avgPos_ = other.avgPos_;
+    avgTime_ = other.avgTime_;
+    shower_flag_ = other.shower_flag_;
+  }
+  return *this;
 }
 
 void ShowerCandidate::clear() {
-    nhits_ = 0;
-    bx_ = 0;
-    wmin_ = 0;
-    wmax_ = 0;
-    avgPos_ = 0;
-    avgTime_ = 0;
-    shower_flag_ = false;
-    wires_profile_.resize(96, 0);
+  nhits_ = 0;
+  bx_ = 0;
+  wmin_ = 0;
+  wmax_ = 0;
+  avgPos_ = 0;
+  avgTime_ = 0;
+  shower_flag_ = false;
+  wires_profile_.resize(96, 0);
 }
