-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renaming class and adding extra res approx clusters
- Loading branch information
Ivan
committed
Apr 30, 2021
1 parent
bbdf8a8
commit 89ca71a
Showing
9 changed files
with
76 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
DataFormats/SiStripCluster/interface/SiStripApproximateClusterHigherBarycenterRes.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef DATAFORMATS_SiStripApproximateClusterHigherBarycenterRes_H | ||
#define DATAFORMATS_SiStripApproximateClusterHigherBarycenterRes_H | ||
|
||
#include <numeric> | ||
#include <cmath> | ||
#include <iostream> | ||
#include <iomanip> | ||
|
||
#include "DataFormats/SiStripCluster/interface/SiStripCluster.h" | ||
|
||
class SiStripApproximateClusterHigherBarycenterRes { | ||
public: | ||
|
||
SiStripApproximateClusterHigherBarycenterRes() {} | ||
explicit SiStripApproximateClusterHigherBarycenterRes(const SiStripCluster& cluster){ | ||
rawBarycenter_=static_cast<uint16_t>(std::round(cluster.barycenter()*8)); | ||
width_=cluster.size(); | ||
if(width_>0x3F) width_=0x3F; | ||
avgCharge_ = static_cast<uint8_t>(cluster.charge()/cluster.size()); | ||
|
||
std::cout << " rawBaricenter " << rawBarycenter_ << | ||
" barycenter: " << this->barycenter() << | ||
" OrigBarycenter: " << cluster.barycenter() << | ||
" OrigBarycenterCasted: " << static_cast<uint16_t>(cluster.barycenter()) << | ||
" OrigBarycenterCastedRounded: " << static_cast<uint16_t>(cluster.barycenter())<< | ||
" ratio " << barycenter()/cluster.barycenter() << std::endl; | ||
} | ||
|
||
|
||
float barycenter() const {return (float)rawBarycenter_/8;} | ||
uint16_t rawBarycenter() const {return rawBarycenter_;} | ||
uint8_t width() const {return width_;} | ||
uint8_t avgCharge() const{return avgCharge_;} | ||
|
||
private: | ||
uint16_t rawBarycenter_ = 0; | ||
uint8_t width_=0; | ||
uint8_t avgCharge_ = 0; | ||
}; | ||
#endif // DATAFORMATS_SiStripApproximateClusterHigherBarycenterRes_H |
32 changes: 0 additions & 32 deletions
32
DataFormats/SiStripCluster/interface/SiStripApproximateClusterv1.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters