Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduction of RAW' data size via adjustment of approx. cluster member data types #39199

Merged
merged 2 commits into from Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions DataFormats/SiStripCluster/BuildFile.xml
Expand Up @@ -2,6 +2,7 @@
<use name="DataFormats/TrajectoryState"/>
<use name="DataFormats/SiStripDigi"/>
<use name="DataFormats/SiStripDetId"/>
<use name="FWCore/Utilities" source_only="1"/>
<export>
<lib name="1"/>
</export>
30 changes: 14 additions & 16 deletions DataFormats/SiStripCluster/interface/SiStripApproximateCluster.h
@@ -1,19 +1,17 @@
#ifndef DATAFORMATS_SISTRIPAPPROXIMATECLUSTER_H
#define DATAFORMATS_SISTRIPAPPROXIMATECLUSTER_H
#ifndef DataFormats_SiStripCluster_SiStripApproximateCluster_h
#define DataFormats_SiStripCluster_SiStripApproximateCluster_h

#include <numeric>
#include <cmath>
#include <iostream>
#include <iomanip>

#include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
#include "FWCore/Utilities/interface/typedefs.h"

class SiStripCluster;
class SiStripApproximateCluster {
public:
SiStripApproximateCluster() {}

explicit SiStripApproximateCluster(float barycenter, uint8_t width, float avgCharge, bool isSaturated) {
explicit SiStripApproximateCluster(cms_uint16_t barycenter,
cms_uint8_t width,
cms_uint8_t avgCharge,
bool isSaturated) {
barycenter_ = barycenter;
width_ = width;
avgCharge_ = avgCharge;
Expand All @@ -22,15 +20,15 @@ class SiStripApproximateCluster {

explicit SiStripApproximateCluster(const SiStripCluster& cluster, unsigned int maxNSat);

float barycenter() const { return barycenter_; }
uint8_t width() const { return width_; }
float avgCharge() const { return avgCharge_; }
cms_uint16_t barycenter() const { return barycenter_; }
cms_uint8_t width() const { return width_; }
cms_uint8_t avgCharge() const { return avgCharge_; }
bool isSaturated() const { return isSaturated_; }

private:
float barycenter_ = 0;
uint8_t width_ = 0;
float avgCharge_ = 0;
cms_uint16_t barycenter_ = 0;
cms_uint8_t width_ = 0;
cms_uint8_t avgCharge_ = 0;
bool isSaturated_ = false;
};
#endif // DATAFORMATS_SiStripApproximateCluster_H
#endif // DataFormats_SiStripCluster_SiStripApproximateCluster_h
5 changes: 4 additions & 1 deletion DataFormats/SiStripCluster/src/SiStripApproximateCluster.cc
@@ -1,7 +1,10 @@
#include "DataFormats/SiStripCluster/interface/SiStripApproximateCluster.h"
#include "DataFormats/SiStripCluster/interface/SiStripCluster.h"
#include <algorithm>
perrotta marked this conversation as resolved.
Show resolved Hide resolved
#include <cmath>

SiStripApproximateCluster::SiStripApproximateCluster(const SiStripCluster& cluster, unsigned int maxNSat) {
barycenter_ = cluster.barycenter();
barycenter_ = std::round(cluster.barycenter() * 10);
width_ = cluster.size();
avgCharge_ = cluster.charge() / cluster.size();
isSaturated_ = false;
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/SiStripCluster/src/SiStripCluster.cc
Expand Up @@ -23,7 +23,7 @@ SiStripCluster::SiStripCluster(const SiStripDigiRange& range) : firstStrip_(rang
}

SiStripCluster::SiStripCluster(const SiStripApproximateCluster cluster, const uint16_t maxStrips) : error_x(-99999.9) {
barycenter_ = cluster.barycenter();
barycenter_ = cluster.barycenter() / 10.0;
charge_ = cluster.width() * cluster.avgCharge();
amplitudes_.resize(cluster.width(), cluster.avgCharge());

Expand Down
3 changes: 2 additions & 1 deletion DataFormats/SiStripCluster/src/classes_def.xml
Expand Up @@ -24,7 +24,8 @@
<class name="edm::Wrapper<edmNew::DetSetVector<edm::Ref<edmNew::DetSetVector<SiStripCluster>,SiStripCluster,edmNew::DetSetVector<SiStripCluster>::FindForDetSetVector> > >" />


<class name="SiStripApproximateCluster" ClassVersion="4">
<class name="SiStripApproximateCluster" ClassVersion="5">
<version ClassVersion="5" checksum="3495825183"/>
<version ClassVersion="4" checksum="2854791577"/>
<version ClassVersion="3" checksum="2041370183"/>
</class>
Expand Down
Expand Up @@ -41,7 +41,7 @@ void SiStripApprox2Clusters::produce(edm::StreamID id, edm::Event& event, const
const auto& clusterCollection = event.get(clusterToken_);

const auto& tkGeom = &iSetup.getData(tkGeomToken_);
const auto tkDets = tkGeom->dets();
const auto& tkDets = tkGeom->dets();

for (const auto& detClusters : clusterCollection) {
edmNew::DetSetVector<SiStripCluster>::FastFiller ff{*result, detClusters.id()};
Expand Down