diff --git a/SimTracker/SiPhase2Digitizer/plugins/Pixel3DDigitizerAlgorithm.cc b/SimTracker/SiPhase2Digitizer/plugins/Pixel3DDigitizerAlgorithm.cc index f9f518095c99c..8db9c5a20675f 100644 --- a/SimTracker/SiPhase2Digitizer/plugins/Pixel3DDigitizerAlgorithm.cc +++ b/SimTracker/SiPhase2Digitizer/plugins/Pixel3DDigitizerAlgorithm.cc @@ -53,9 +53,15 @@ void Pixel3DDigitizerAlgorithm::init(const edm::EventSetup& es) { Pixel3DDigitizerAlgorithm::Pixel3DDigitizerAlgorithm(const edm::ParameterSet& conf) : Phase2TrackerDigitizerAlgorithm(conf.getParameter("AlgorithmCommon"), conf.getParameter("Pixel3DDigitizerAlgorithm")), - _np_column_radius((conf.getParameter("Pixel3DDigitizerAlgorithm").getParameter("NPColumnRadius"))*1.0_um), - _ohm_column_radius((conf.getParameter("Pixel3DDigitizerAlgorithm").getParameter("OhmicColumnRadius"))*1.0_um), - _np_column_gap((conf.getParameter("Pixel3DDigitizerAlgorithm").getParameter("NPColumnGap"))*1.0_um) { + _np_column_radius( + (conf.getParameter("Pixel3DDigitizerAlgorithm").getParameter("NPColumnRadius")) * + 1.0_um), + _ohm_column_radius( + (conf.getParameter("Pixel3DDigitizerAlgorithm").getParameter("OhmicColumnRadius")) * + 1.0_um), + _np_column_gap( + (conf.getParameter("Pixel3DDigitizerAlgorithm").getParameter("NPColumnGap")) * + 1.0_um) { // XXX - NEEDED? pixelFlag_ = true; @@ -80,7 +86,7 @@ bool Pixel3DDigitizerAlgorithm::select_hit(const PSimHit& hit, double tCorr, dou return (time >= theTofLowerCut_ && time < theTofUpperCut_); } -const bool Pixel3DDigitizerAlgorithm::_is_inside_n_column(const LocalPoint& p, const float & sensor_thickness) const { +const bool Pixel3DDigitizerAlgorithm::_is_inside_n_column(const LocalPoint& p, const float& sensor_thickness) const { // The insensitive volume of the column: sensor thickness - column gap distance return (p.perp() <= _np_column_radius && p.z() <= (sensor_thickness - _np_column_gap)); } @@ -323,9 +329,9 @@ std::vector Pixel3DDigitizerAlgorithm::drift( const float pixel_x = current_pixel_int.first + (mc.x() + center_proxy_cell.x()) / pitch.first; const float pixel_y = current_pixel_int.second + (mc.y() + center_proxy_cell.y()) / pitch.second; const auto lp = pixdet->specificTopology().localPosition(MeasurementPoint(pixel_x, pixel_y)); - //Remember: the drift function will move the reference system to the bottom. We need to add what we previously subtract - //in order to avoid a double translation when calling the drift function once again below - mc.migrate_position(LocalPoint(lp.x(), lp.y(), mc.z() + center_proxy_cell.z())); + //Remember: the drift function will move the reference system to the bottom. We need to add what we previously subtract + //in order to avoid a double translation when calling the drift function once again below + mc.migrate_position(LocalPoint(lp.x(), lp.y(), mc.z() + center_proxy_cell.z())); } if (!migrated_charges.empty()) { LogDebug("Pixel3DDigitizerAlgorithm::drift") << "****************" diff --git a/SimTracker/SiPhase2Digitizer/plugins/Pixel3DDigitizerAlgorithm.h b/SimTracker/SiPhase2Digitizer/plugins/Pixel3DDigitizerAlgorithm.h index 096cd22b61a04..6bb7f3ca369b4 100644 --- a/SimTracker/SiPhase2Digitizer/plugins/Pixel3DDigitizerAlgorithm.h +++ b/SimTracker/SiPhase2Digitizer/plugins/Pixel3DDigitizerAlgorithm.h @@ -59,11 +59,11 @@ class Pixel3DDigitizerAlgorithm : public Phase2TrackerDigitizerAlgorithm { const float _np_column_radius; const float _ohm_column_radius; // Gap of np column - const float _np_column_gap; + const float _np_column_gap; // Check if a carrier is inside the column: The point should // be described in the pixel cell frame - const bool _is_inside_n_column(const LocalPoint& p, const float & sensor_thickness) const; + const bool _is_inside_n_column(const LocalPoint& p, const float& sensor_thickness) const; const bool _is_inside_ohmic_column(const LocalPoint& p, const std::pair& pitch) const; }; #endif diff --git a/SimTracker/SiPhase2Digitizer/test/PixelTestBeamValidation.cc b/SimTracker/SiPhase2Digitizer/test/PixelTestBeamValidation.cc index b8a9049d0274d..d7145e4c8ef7e 100644 --- a/SimTracker/SiPhase2Digitizer/test/PixelTestBeamValidation.cc +++ b/SimTracker/SiPhase2Digitizer/test/PixelTestBeamValidation.cc @@ -191,7 +191,7 @@ void PixelTestBeamValidation::analyze(const edm::Event& iEvent, const edm::Event const int layer = topo->layer(detId); // Get the relevant histo key const auto& me_unit = meUnit_(tkDetUnit->type().isBarrel(), layer, topo->side(detId)); - + // Get the id of the detector unit const unsigned int detId_raw = detId.rawId(); @@ -199,15 +199,15 @@ void PixelTestBeamValidation::analyze(const edm::Event& iEvent, const edm::Event // in this detector unit std::vector it_simhits; - for (const auto* sh_c : simhits){ - for (const auto& sh : *sh_c){ - if (sh.detUnitId() == detId_raw){ - it_simhits.push_back(&sh); //insert and/or reserve (?) - } + for (const auto* sh_c : simhits) { + for (const auto& sh : *sh_c) { + if (sh.detUnitId() == detId_raw) { + it_simhits.push_back(&sh); //insert and/or reserve (?) + } } } - if (it_simhits.size() == 0){ + if (it_simhits.size() == 0) { continue; } @@ -220,8 +220,7 @@ void PixelTestBeamValidation::analyze(const edm::Event& iEvent, const edm::Event // by the primary+secundaries) to check if they are associated with // some digi, that is, if the simdigi link exists and to obtain the list // of channels illuminated - for (const auto* psh : it_simhits){ - + for (const auto* psh : it_simhits) { // Check user conditions to accept the hits if (!use_this_track_(psh)) { continue; @@ -324,21 +323,17 @@ void PixelTestBeamValidation::analyze(const edm::Event& iEvent, const edm::Event vME_dx_cell_[me_unit][i]->Fill(icell_psh.first * 1.0_inv_um, icell_psh.second * 1.0_inv_um, dx_um); vME_dy_cell_[me_unit][i]->Fill(icell_psh.first * 1.0_inv_um, icell_psh.second * 1.0_inv_um, dy_um); // Charge - vME_charge_cell_[me_unit][i]->Fill( - icell_psh.first * 1.0_inv_um, icell_psh.second * 1.0_inv_um, cluster_tot); + vME_charge_cell_[me_unit][i]->Fill(icell_psh.first * 1.0_inv_um, icell_psh.second * 1.0_inv_um, cluster_tot); vME_charge_elec_cell_[me_unit][i]->Fill( icell_psh.first * 1.0_inv_um, icell_psh.second * 1.0_inv_um, cluster_tot_elec); // Cluster size - vME_clsize_cell_[me_unit][i]->Fill( - icell_psh.first * 1.0_inv_um, icell_psh.second * 1.0_inv_um, cluster_size); + vME_clsize_cell_[me_unit][i]->Fill(icell_psh.first * 1.0_inv_um, icell_psh.second * 1.0_inv_um, cluster_size); } } } } } - - // // -- Book Histograms // @@ -684,25 +679,24 @@ bool PixelTestBeamValidation::channel_iluminated_by_(const PSimHit& ps, } std::set PixelTestBeamValidation::get_illuminated_channels_(const PSimHit& ps, - const DetId& detid, - const edm::DetSetVector* simdigis){ + const DetId& detid, + const edm::DetSetVector* simdigis) { // Find simulated digi links (simdigis) created in this det unit const auto& it_simdigilink = simdigis->find(detid); - if (it_simdigilink == simdigis->end()){ + if (it_simdigilink == simdigis->end()) { return std::set(); } std::set channels; - for (const auto& hdsim : *it_simdigilink){ - if (ps.trackId() == hdsim.SimTrackId()){ + for (const auto& hdsim : *it_simdigilink) { + if (ps.trackId() == hdsim.SimTrackId()) { channels.insert(hdsim.channel()); } } return channels; } - std::set> PixelTestBeamValidation::get_illuminated_pixels_(const PSimHit& ps, const PixelGeomDetUnit* tkDetUnit) { auto ps_key = reinterpret_cast(&ps); diff --git a/SimTracker/SiPhase2Digitizer/test/PixelTestBeamValidation.h b/SimTracker/SiPhase2Digitizer/test/PixelTestBeamValidation.h index bc246c7f51515..25720d0020e37 100644 --- a/SimTracker/SiPhase2Digitizer/test/PixelTestBeamValidation.h +++ b/SimTracker/SiPhase2Digitizer/test/PixelTestBeamValidation.h @@ -93,9 +93,9 @@ class PixelTestBeamValidation : public DQMEDAnalyzer { bool channel_iluminated_by_(const PSimHit &localpos, int channel, const PixelGeomDetUnit *tkDet); // The list of channels illuminated by the PSimHit - std::set get_illuminated_channels_(const PSimHit& ps, - const DetId& detid, - const edm::DetSetVector* simdigis); + std::set get_illuminated_channels_(const PSimHit &ps, + const DetId &detid, + const edm::DetSetVector *simdigis); // The list of pixels illuminated by the PSimHit std::set> get_illuminated_pixels_(const PSimHit &ps, const PixelGeomDetUnit *tkDetUnit);