Skip to content

Commit

Permalink
Apply clang format on Tracking pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
tvami authored and tomeichlersmith committed Jun 5, 2024
1 parent 37b94be commit 98c58a1
Show file tree
Hide file tree
Showing 74 changed files with 3,922 additions and 4,375 deletions.
42 changes: 19 additions & 23 deletions Tracking/include/Tracking/Digitization/CDFSiSensorSim.h
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
#pragma once

#include <map>

#include "Acts/Definitions/Algebra.hpp"
#include "Tracking/Digitization/ChargeCarrier.h"
#include "Tracking/Digitization/SiElectrodeDataCollection.h"
#include "Acts/Definitions/Algebra.hpp"
#include <map>

namespace tracking {
namespace digitization {
namespace digitization {

class CDFSiSensorSim {

// Static parameters - not intended to be user modifiable

//10% of pitch or depleted thickness
//static double deposition_granularity_ = 0.10;
//static double distance_error_threshold_ = 0.001;


//Field
//SiSensor _sensor = null;

// 10% of pitch or depleted thickness
// static double deposition_granularity_ = 0.10;
// static double distance_error_threshold_ = 0.001;

// Field
// SiSensor _sensor = null;

CDFSiSensorSim();

Expand All @@ -35,25 +34,22 @@ class CDFSiSensorSim {
// Simulate charge deposition
std::map<ChargeCarrier, SiElectrodeDataCollection> computeElectrodeData();
*/

private:

std::map<ChargeCarrier,Acts::Vector3> _drift_direction;
std::map<ChargeCarrier,SiElectrodeDataCollection> _sense_data;
std::map<ChargeCarrier,SiElectrodeDataCollection> _readout_data;
private:
std::map<ChargeCarrier, Acts::Vector3> _drift_direction;
std::map<ChargeCarrier, SiElectrodeDataCollection> _sense_data;
std::map<ChargeCarrier, SiElectrodeDataCollection> _readout_data;

// Simple simulation of charge trapping, this is a temporary kludge.
// Charge collection efficiency with linear drift distance dependence.
// Input is fraction lost per 100um drift: 0.2 is typical for 1E15 NEQ.
// FIXME: should be calculated from properties of DopedSilicon (radiation dose)
// FIXME: should be calculated from properties of DopedSilicon (radiation
// dose)

double trapping_{0.0};

bool debug_{false};


};


} // digitization
}// tracking
} // namespace digitization
} // namespace tracking
100 changes: 48 additions & 52 deletions Tracking/include/Tracking/Digitization/ChargeCarrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,59 @@
*/

namespace tracking {
namespace digitization {
namespace digitization {

static const double TCOEFF = 300.0;


class ChargeCarrier {
static const double TCOEFF = 300.0;

public:
class ChargeCarrier {
public:
ChargeCarrier(int charge, double mu_0_factor, double mu_0_exponent,
double mu_min_factor, double mu_min_exponent,
double N_ref_factor, double N_ref_exponent, double alpha_factor,
double alpha_exponent) {
charge_ = charge;
mu_0_factor_ = mu_0_factor;
mu_0_exponent_ = mu_0_exponent;
mu_min_factor_ = mu_min_factor;
mu_min_exponent_ = mu_min_exponent;
N_ref_factor_ = N_ref_factor;
N_ref_exponent_ = N_ref_exponent;
alpha_factor_ = alpha_factor;
alpha_exponent_ = alpha_exponent;
}

ChargeCarrier(int charge, double mu_0_factor, double mu_0_exponent,
double mu_min_factor, double mu_min_exponent,
double N_ref_factor, double N_ref_exponent,
double alpha_factor, double alpha_exponent) {
int charge() { return charge_; }

charge_ = charge;
mu_0_factor_ = mu_0_factor;
mu_0_exponent_ = mu_0_exponent;
mu_min_factor_ = mu_min_factor;
mu_min_exponent_ = mu_min_exponent;
N_ref_factor_ = N_ref_factor;
N_ref_exponent_ = N_ref_exponent;
alpha_factor_ = alpha_factor;
alpha_exponent_ = alpha_exponent;
}
double mu0(double temperature);
double muMin(double temperature);
double nRef(double temperature);
double alpha(double temperature);

int charge() {return charge_;}
private:
int charge_;
double mu_0_factor_;
double mu_0_exponent_;
double mu_min_factor_;
double mu_min_exponent_;
double N_ref_factor_;
double N_ref_exponent_;
double alpha_factor_;
double alpha_exponent_;
};

double mu0 (double temperature);
double muMin (double temperature);
double nRef (double temperature);
double alpha (double temperature);


private:
static const ChargeCarrier electron(-1, 1268.0, -2.33, 92.0, -0.57, 1.3E+17,
2.4, 0.91, -0.146);
static const ChargeCarrier hole(1, 406.9, -2.23, 54.3, -0.57, 2.35E+17, 2.4,
0.88, -0.146);

int charge_;
double mu_0_factor_;
double mu_0_exponent_;
double mu_min_factor_;
double mu_min_exponent_;
double N_ref_factor_;
double N_ref_exponent_;
double alpha_factor_;
double alpha_exponent_;

};
static ChargeCarrier getCarrier(int charge) {
if (charge == -1)
return electron;
else if (charge == 1)
return hole;
else
throw std::invalid_argument("No ChargeCarrier for charge specified");
}


static const ChargeCarrier electron(-1,1268.0,-2.33,92.0,-0.57,1.3E+17,2.4,0.91,-0.146);
static const ChargeCarrier hole(1,406.9,-2.23,54.3,-0.57,2.35E+17,2.4,0.88,-0.146);

static ChargeCarrier getCarrier(int charge) {
if (charge == -1) return electron;
else if (charge == 1) return hole;
else throw std::invalid_argument("No ChargeCarrier for charge specified");
}


} // tracking
} // digitization
} // namespace digitization
} // namespace tracking
34 changes: 9 additions & 25 deletions Tracking/include/Tracking/Digitization/GaussianDistribution2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,24 @@

#include "Acts/Definitions/Algebra.hpp"


class GaussianDistribution2D {

public:


GaussianDistribution2D(double normalization,
const Acts::Vector3& mean,
public:
GaussianDistribution2D(double normalization, const Acts::Vector3& mean,
const Acts::Vector3& major_axis,
const Acts::Vector3& minor_axis);


void transform(const Acts::Transform3& transform) ;
void transform(const Acts::Transform3& transform);
GaussianDistribution2D transformed(const Acts::Transform3& transform);


double getNormalization(){return normalization_;};
Acts::Vector3 getMean(){return mean_;};
double getNormalization() { return normalization_; };
Acts::Vector3 getMean() { return mean_; };
double sigma1D(const Acts::Vector3& axis);
double covxy(const Acts::Vector3& xaxis, const Acts::Vector3 yaxis);
double upperIntegral1D(const Acts::Vector3& axis, double integration_limit);


private:


private:
double normalization_{1.0};
Acts::Vector3 mean_{0.,0.,0.};
Acts::Vector3 major_axis_{0.,0.,0.};
Acts::Vector3 minor_axis_{0.,0.,0.};






Acts::Vector3 mean_{0., 0., 0.};
Acts::Vector3 major_axis_{0., 0., 0.};
Acts::Vector3 minor_axis_{0., 0., 0.};
};
115 changes: 49 additions & 66 deletions Tracking/include/Tracking/Digitization/SiElectrodeData.h
Original file line number Diff line number Diff line change
@@ -1,72 +1,55 @@
#pragma once

//---< SimCore >---//
#include "SimCore/Event/SimTrackerHit.h"
#include <set>

#include "SimCore/Event/SimTrackerHit.h"

namespace tracking {
namespace digitization {

class SiElectrodeData {

public:

SiElectrodeData();

SiElectrodeData(int charge) {
charge_ = charge;
}

~SiElectrodeData() {
sim_hits_.clear();
}

SiElectrodeData(int charge, const ldmx::SimTrackerHit& sim_hit) {

charge_ = charge;
sim_hits_.insert(sim_hit);
}

// TODO:: Maybe use the vector directly?
SiElectrodeData(int charge,
const std::vector<ldmx::SimTrackerHit>& sim_hits) {

charge_ = charge;

for (auto& sim_hit : sim_hits) {
sim_hits_.insert(sim_hit);
}
}


bool isValid() const {
return (getCharge() != 0);
}

int getCharge() const {return charge_;}

std::set<ldmx::SimTrackerHit> getSimulatedHits() const {
return sim_hits_;
}


//TODO Change to operator overloading for cleaner code
SiElectrodeData add(const SiElectrodeData& electrode_data);

SiElectrodeData add(int charge, std::set<ldmx::SimTrackerHit> simulated_hits);

SiElectrodeData addCharge(int charge);

SiElectrodeData addSimulatedHit(const ldmx::SimTrackerHit hit);


private:

int charge_{};
std::set<ldmx::SimTrackerHit> sim_hits_;

};


} // digitization
} // tracking
namespace digitization {

class SiElectrodeData {
public:
SiElectrodeData();

SiElectrodeData(int charge) { charge_ = charge; }

~SiElectrodeData() { sim_hits_.clear(); }

SiElectrodeData(int charge, const ldmx::SimTrackerHit& sim_hit) {
charge_ = charge;
sim_hits_.insert(sim_hit);
}

// TODO:: Maybe use the vector directly?
SiElectrodeData(int charge,
const std::vector<ldmx::SimTrackerHit>& sim_hits) {
charge_ = charge;

for (auto& sim_hit : sim_hits) {
sim_hits_.insert(sim_hit);
}
}

bool isValid() const { return (getCharge() != 0); }

int getCharge() const { return charge_; }

std::set<ldmx::SimTrackerHit> getSimulatedHits() const { return sim_hits_; }

// TODO Change to operator overloading for cleaner code
SiElectrodeData add(const SiElectrodeData& electrode_data);

SiElectrodeData add(int charge, std::set<ldmx::SimTrackerHit> simulated_hits);

SiElectrodeData addCharge(int charge);

SiElectrodeData addSimulatedHit(const ldmx::SimTrackerHit hit);

private:
int charge_{};
std::set<ldmx::SimTrackerHit> sim_hits_;
};

} // namespace digitization
} // namespace tracking
Loading

0 comments on commit 98c58a1

Please sign in to comment.