Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
claralasa committed Oct 28, 2020
1 parent 23d42ab commit 1769b9f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
20 changes: 13 additions & 7 deletions SimTracker/SiPhase2Digitizer/plugins/Pixel3DDigitizerAlgorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,15 @@ void Pixel3DDigitizerAlgorithm::init(const edm::EventSetup& es) {
Pixel3DDigitizerAlgorithm::Pixel3DDigitizerAlgorithm(const edm::ParameterSet& conf)
: Phase2TrackerDigitizerAlgorithm(conf.getParameter<edm::ParameterSet>("AlgorithmCommon"),
conf.getParameter<edm::ParameterSet>("Pixel3DDigitizerAlgorithm")),
_np_column_radius((conf.getParameter<edm::ParameterSet>("Pixel3DDigitizerAlgorithm").getParameter<double>("NPColumnRadius"))*1.0_um),
_ohm_column_radius((conf.getParameter<edm::ParameterSet>("Pixel3DDigitizerAlgorithm").getParameter<double>("OhmicColumnRadius"))*1.0_um),
_np_column_gap((conf.getParameter<edm::ParameterSet>("Pixel3DDigitizerAlgorithm").getParameter<double>("NPColumnGap"))*1.0_um) {
_np_column_radius(
(conf.getParameter<edm::ParameterSet>("Pixel3DDigitizerAlgorithm").getParameter<double>("NPColumnRadius")) *
1.0_um),
_ohm_column_radius(
(conf.getParameter<edm::ParameterSet>("Pixel3DDigitizerAlgorithm").getParameter<double>("OhmicColumnRadius")) *
1.0_um),
_np_column_gap(
(conf.getParameter<edm::ParameterSet>("Pixel3DDigitizerAlgorithm").getParameter<double>("NPColumnGap")) *
1.0_um) {
// XXX - NEEDED?
pixelFlag_ = true;

Expand All @@ -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));
}
Expand Down Expand Up @@ -323,9 +329,9 @@ std::vector<DigitizerUtility::SignalPoint> 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") << "****************"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<float, float>& pitch) const;
};
#endif
36 changes: 15 additions & 21 deletions SimTracker/SiPhase2Digitizer/test/PixelTestBeamValidation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,23 +191,23 @@ 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();

// Loop over the simhits to obtain the list of PSimHits created
// in this detector unit
std::vector<const PSimHit*> 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;
}

Expand All @@ -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;
Expand Down Expand Up @@ -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
//
Expand Down Expand Up @@ -684,25 +679,24 @@ bool PixelTestBeamValidation::channel_iluminated_by_(const PSimHit& ps,
}

std::set<int> PixelTestBeamValidation::get_illuminated_channels_(const PSimHit& ps,
const DetId& detid,
const edm::DetSetVector<PixelDigiSimLink>* simdigis){
const DetId& detid,
const edm::DetSetVector<PixelDigiSimLink>* 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<int>();
}

std::set<int> 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<std::pair<int, int>> PixelTestBeamValidation::get_illuminated_pixels_(const PSimHit& ps,
const PixelGeomDetUnit* tkDetUnit) {
auto ps_key = reinterpret_cast<std::uintptr_t>(&ps);
Expand Down
6 changes: 3 additions & 3 deletions SimTracker/SiPhase2Digitizer/test/PixelTestBeamValidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> get_illuminated_channels_(const PSimHit& ps,
const DetId& detid,
const edm::DetSetVector<PixelDigiSimLink>* simdigis);
std::set<int> get_illuminated_channels_(const PSimHit &ps,
const DetId &detid,
const edm::DetSetVector<PixelDigiSimLink> *simdigis);

// The list of pixels illuminated by the PSimHit
std::set<std::pair<int, int>> get_illuminated_pixels_(const PSimHit &ps, const PixelGeomDetUnit *tkDetUnit);
Expand Down

0 comments on commit 1769b9f

Please sign in to comment.