Skip to content

Commit

Permalink
Merge pull request #3 from cms-sw/master
Browse files Browse the repository at this point in the history
pull from cmssw/master
  • Loading branch information
marco-link committed Apr 21, 2021
2 parents 56ef8c1 + 8385c0c commit 9ad81cf
Show file tree
Hide file tree
Showing 724 changed files with 24,867 additions and 11,169 deletions.
1 change: 0 additions & 1 deletion Alignment/LaserAlignmentSimulation/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<library file="LaserOpticalPhysics.cc">
<use name="Alignment/LaserAlignmentSimulation"/>
<use name="SimG4Core/Physics"/>
<use name="SimG4Core/PhysicsLists"/>
<use name="geant4core"/>
<flags EDM_PLUGIN="1"/>
</library>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "G4HadronPhysicsQGSP_FTFP_BERT.hh"

#include "SimG4Core/Physics/interface/PhysicsListFactory.h"
#include "SimG4Core/PhysicsLists/interface/CMSEmStandardPhysics.h"

#include "G4EmStandardPhysics_option1.hh"
#include "G4DecayPhysics.hh"
#include "G4EmExtraPhysics.hh"
#include "G4HadronElasticPhysics.hh"
Expand All @@ -29,7 +29,7 @@ LaserOpticalPhysics::LaserOpticalPhysics(const edm::ParameterSet &p) : PhysicsLi
<< std::endl;

// EM Physics
RegisterPhysics(new CMSEmStandardPhysics(ver));
RegisterPhysics(new G4EmStandardPhysics_option1(ver));
// Synchroton Radiation & GN Physics
RegisterPhysics(new G4EmExtraPhysics(ver));
// Decays
Expand Down
6 changes: 3 additions & 3 deletions CUDADataFormats/HGCal/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<use name="FWCore/Utilities"/>
<use name="Geometry/HGCalGeometry"/>
<use name="HeterogeneousCore/CUDACore"/>
<use name="CUDADataFormats/Common"/>
<use name="DataFormats/Common"/>
<use name="HeterogeneousCore/CUDAUtilities"/>
<use name="cuda"/>

<export>
Expand Down
12 changes: 0 additions & 12 deletions CUDADataFormats/SiPixelCluster/interface/gpuClusteringConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@
#include <cstdint>
#include <limits>

namespace pixelGPUConstants {
#ifdef GPU_SMALL_EVENTS
// kept for testing and debugging
constexpr uint32_t maxNumberOfHits = 24 * 1024;
#else
// data at pileup 50 has 18300 +/- 3500 hits; 40000 is around 6 sigma away
// tested on MC events with 55-75 pileup events
constexpr uint32_t maxNumberOfHits = 48 * 1024;
#endif
} // namespace pixelGPUConstants

namespace gpuClustering {
#ifdef GPU_SMALL_EVENTS
// kept for testing and debugging
Expand All @@ -28,7 +17,6 @@ namespace gpuClustering {

constexpr uint16_t maxNumModules = 2000;
constexpr int32_t maxNumClustersPerModules = maxHitsInModule();
constexpr uint32_t maxNumClusters = pixelGPUConstants::maxNumberOfHits;
constexpr uint16_t invalidModuleId = std::numeric_limits<uint16_t>::max() - 1;
static_assert(invalidModuleId > maxNumModules); // invalidModuleId must be > maxNumModules

Expand Down
2 changes: 1 addition & 1 deletion CUDADataFormats/Track/interface/TrackSoAHeterogeneousT.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TrackSoAHeterogeneousT {

using Quality = pixelTrack::Quality;
using hindex_type = uint32_t;
using HitContainer = cms::cuda::OneToManyAssoc<hindex_type, S, 5 * S>;
using HitContainer = cms::cuda::OneToManyAssoc<hindex_type, S + 1, 5 * S>;

// Always check quality is at least loose!
// CUDA does not support enums in __lgc ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class TrackingRecHit2DHeterogeneous {
auto hitsModuleStart() const { return m_hitsModuleStart; }
auto hitsLayerStart() { return m_hitsLayerStart; }
auto phiBinner() { return m_phiBinner; }
auto phiBinnerStorage() { return m_phiBinnerStorage; }
auto iphi() { return m_iphi; }

// only the local coord and detector index
Expand All @@ -42,7 +43,7 @@ class TrackingRecHit2DHeterogeneous {

private:
static constexpr uint32_t n16 = 4; // number of elements in m_store16
static constexpr uint32_t n32 = 9; // number of elements in m_store32
static constexpr uint32_t n32 = 10; // number of elements in m_store32
static_assert(sizeof(uint32_t) == sizeof(float)); // just stating the obvious

unique_ptr<uint16_t[]> m_store16; //!
Expand All @@ -59,6 +60,7 @@ class TrackingRecHit2DHeterogeneous {

// needed as kernel params...
PhiBinner* m_phiBinner;
PhiBinner::index_type* m_phiBinnerStorage;
uint32_t* m_hitsLayerStart;
int16_t* m_iphi;
};
Expand Down Expand Up @@ -97,14 +99,20 @@ TrackingRecHit2DHeterogeneous<Traits>::TrackingRecHit2DHeterogeneous(uint32_t nH
// this will break 1to1 correspondence with cluster and module locality
// so unless proven VERY inefficient we keep it ordered as generated
m_store16 = Traits::template make_device_unique<uint16_t[]>(nHits * n16, stream);
m_store32 = Traits::template make_device_unique<float[]>(nHits * n32 + 11, stream);
m_store32 =
Traits::template make_device_unique<float[]>(nHits * n32 + phase1PixelTopology::numberOfLayers + 1, stream);
m_PhiBinnerStore = Traits::template make_device_unique<TrackingRecHit2DSOAView::PhiBinner>(stream);

static_assert(sizeof(TrackingRecHit2DSOAView::hindex_type) == sizeof(float));
static_assert(sizeof(TrackingRecHit2DSOAView::hindex_type) == sizeof(TrackingRecHit2DSOAView::PhiBinner::index_type));

auto get16 = [&](int i) { return m_store16.get() + i * nHits; };
auto get32 = [&](int i) { return m_store32.get() + i * nHits; };

// copy all the pointers
m_phiBinner = view->m_phiBinner = m_PhiBinnerStore.get();
m_phiBinnerStorage = view->m_phiBinnerStorage =
reinterpret_cast<TrackingRecHit2DSOAView::PhiBinner::index_type*>(get32(9));

view->m_xl = get32(0);
view->m_yl = get32(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ namespace pixelCPEforGPU {

class TrackingRecHit2DSOAView {
public:
static constexpr uint32_t maxHits() { return gpuClustering::maxNumClusters; }
using hindex_type = uint32_t; // if above is <=2^32

using PhiBinner =
cms::cuda::HistoContainer<int16_t, 128, gpuClustering::maxNumClusters, 8 * sizeof(int16_t), hindex_type, 10>;
using PhiBinner = cms::cuda::HistoContainer<int16_t, 128, -1, 8 * sizeof(int16_t), hindex_type, 10>;

using AverageGeometry = phase1PixelTopology::AverageGeometry;

Expand Down Expand Up @@ -95,6 +93,7 @@ class TrackingRecHit2DSOAView {
uint32_t* m_hitsLayerStart;

PhiBinner* m_phiBinner;
PhiBinner::index_type* m_phiBinnerStorage;

uint32_t m_nHits;
};
Expand Down
18 changes: 10 additions & 8 deletions CalibCalorimetry/EcalLaserAnalyzer/interface/TFParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
#include "TVirtualX.h"
#include "TObject.h"
//#include "TMatrixD.h"
#define SDIM2 10 /* number of samples for cristal */
#define PLSHDIM 650 /* size of the pulse shape array */
//double pulseShape( Double_t x[1], Double_t par[4] ) ;
//

struct matrice {
int nb_lignes;
int nb_colonnes;
Expand All @@ -38,11 +35,14 @@ matrice cree_mat_prod(matrice, matrice);
void fill_mat(matrice, matrice);
matrice fill_mat_int(matrice, matrice, matrice);

#define dimmat 30
#define dimout 10
#define nbmax_cell 1000

class TFParams : public TObject {
public:
static constexpr unsigned int dimmat = 30;
static constexpr unsigned int dimout = 10;
static constexpr unsigned int nbmax_cell = 1000;
static constexpr int SDIM2 = 10;
static constexpr int PLSHDIM = 650;

private:
int ns; // number of samples
int nsmin; // beginning of fit
Expand All @@ -57,6 +57,8 @@ class TFParams : public TObject {
int METHODE;

public:
/* number of samples for cristal */
/* size of the pulse shape array */
TFParams(int size = SDIM2, int size_sh = PLSHDIM);
~TFParams() override{};
double fitpj(double **, double *, double **, double noise_val, int debug);
Expand Down
81 changes: 37 additions & 44 deletions CalibCalorimetry/EcalLaserAnalyzer/interface/TMCReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,62 @@

#include "TObject.h"

#define FNPNMAX 10
#define FNLMODNMAX 9
#define FNCHANMAX 200

#define fNpns 2
#define fNchans 400
#define fNbins 102

class TMCReader: public TObject
{

private:

int smN,nlmodN,arr[FNLMODNMAX];
long int timestart,timestop;
float evts[fNpns+1][FNCHANMAX+FNPNMAX];
double min[fNpns+1][FNCHANMAX+FNPNMAX],max[fNpns+1][FNCHANMAX+FNPNMAX];
double val[fNpns+1][FNCHANMAX+FNPNMAX],sig[fNpns+1][FNCHANMAX+FNPNMAX];
double wbin[fNpns+1][FNCHANMAX+FNPNMAX];
class TMCReader : public TObject {
public:
static constexpr unsigned int FNPNMAX = 10;
static constexpr unsigned int FNLMODNMAX = 9;
static constexpr unsigned int FNCHANMAX = 200;
static constexpr unsigned int fNpns = 2;
static constexpr unsigned int fNchans = 400;
static constexpr unsigned int fNbins = 102;

private:
int smN, nlmodN, arr[FNLMODNMAX];
long int timestart, timestop;
float evts[fNpns + 1][FNCHANMAX + FNPNMAX];
double min[fNpns + 1][FNCHANMAX + FNPNMAX], max[fNpns + 1][FNCHANMAX + FNPNMAX];
double val[fNpns + 1][FNCHANMAX + FNPNMAX], sig[fNpns + 1][FNCHANMAX + FNPNMAX];
double wbin[fNpns + 1][FNCHANMAX + FNPNMAX];
float sumprob;

int smlocal,color,lmdir,part;
int smlocal, color, lmdir, part;

void init();

public:
public:
// Default Constructor, mainly for Root
TMCReader();

// Destructor: Does nothing
virtual ~TMCReader();

void validMCLaser(int,int);
void getMCLaserData(int,int);
void validMCLaser(int, int);
void getMCLaserData(int, int);
void validMCPulse(int);
void getMCPulseData(int);

int getSMNumb() {return smN;}
int getNbOflmodN() {return nlmodN;}
int getlmodN(int indx) {return arr[indx];}
int getstartime() {return timestart;}
int getstoptime() {return timestop;}
int getnevts(int norm) {return (int) evts[norm][0];}
int getSMNumb() { return smN; }
int getNbOflmodN() { return nlmodN; }
int getlmodN(int indx) { return arr[indx]; }
int getstartime() { return timestart; }
int getstoptime() { return timestop; }
int getnevts(int norm) { return (int)evts[norm][0]; }

void setsmlocal(int sm) {smlocal=sm;}
void setcolor(int c) {color=c;}
void setdirlmodN(int lmp) {lmdir=lmp;}
void setpartition(int p) {part=p;}
void setsmlocal(int sm) { smlocal = sm; }
void setcolor(int c) { color = c; }
void setdirlmodN(int lmp) { lmdir = lmp; }
void setpartition(int p) { part = p; }

void changedatatoraw(int,int,int);
void changedatatopeak(int,int,int);

void printeinjData(int,int,int);
void printlaserData(int,int,int,int);
void printlaserpeak(int,int,int);
void printnormlaserData(int,int,int,int,int);
void printnormlaserpeak(int,int,int,int);
void changedatatoraw(int, int, int);
void changedatatopeak(int, int, int);

void printeinjData(int, int, int);
void printlaserData(int, int, int, int);
void printlaserpeak(int, int, int);
void printnormlaserData(int, int, int, int, int);
void printnormlaserpeak(int, int, int, int);

// ClassDef(TMCReader,1)
};

#endif



0 comments on commit 9ad81cf

Please sign in to comment.