Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120895
b: "refs/heads/CMSSW_7_0_X"
c: d77521f
h: "refs/heads/CMSSW_7_0_X"
i:
  120893: 4e4bfc6
  120891: 828b298
  120887: 1258930
  120879: 13143f9
  120863: 64b4a76
  120831: 9eb7416
v: v3
  • Loading branch information
Andrea Venturi committed Oct 4, 2012
1 parent fcffb75 commit f24d9e7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"refs/heads/hi_d20131223": d7335b053d7fe03e98f9f59af6a20004362628e8
refs/heads/gh-pages: a3d9046c56a3ca3dc64ad63f7295276c81ac876a
"refs/heads/analysis_53X_01": 3019419e9784b2b092fc6b5c503b2e0177cbe926
"refs/heads/CMSSW_7_0_X": 2586f94d087b06e994f6e2ba738e1127e3915006
"refs/heads/CMSSW_7_0_X": d77521f9d484ef6dbb19ace0c55ff3e56f4cf518
1 change: 1 addition & 0 deletions trunk/DataFormats/TrackerCommon/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<use name="FWCore/ParameterSet"/>
<use name="CommonTools/Utils"/>
<use name="FWCore/ServiceRegistry"/>
<use name="FWCore/MessageLogger"/>
<use name="rootcintex"/>
<use name="root"/>
<use name="CommonTools/UtilAlgos"/>
Expand Down
12 changes: 7 additions & 5 deletions trunk/DataFormats/TrackerCommon/interface/ClusterSummary.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//
// Original Author: Michael Segala
// Created: Wed Feb 23 17:36:23 CST 2011
// $Id: ClusterSummary.h,v 1.4 2012/05/14 09:11:37 eulisse Exp $
// $Id: ClusterSummary.h,v 1.5 2012/10/03 13:29:02 msegala Exp $
//
//

Expand Down Expand Up @@ -177,15 +177,16 @@ class ClusterSummary {


//Get value of any variable given location of the variable within userContent and the module number based on enum CMSTracker
double GetGenericVariable( int variableLocation, int module ) const { return genericVariables_[variableLocation][GetModuleLocation(module)]; }
double GetGenericVariable( int variableLocation, int module ) const {
return GetModuleLocation(module) < 0 ? 0. : genericVariables_[variableLocation][GetModuleLocation(module)]; }

//Get value of any variable given variable name and the module number based on enum CMSTracker
double GetGenericVariable( std::string variableName, int module ) const {

int position = GetVariableLocation(variableName);
int mposition = GetModuleLocation(module);

return genericVariables_[position][mposition];
return mposition < 0 ? 0. : genericVariables_[position][mposition];
}

//Get specific varibale for all modules using the variable name
Expand All @@ -202,7 +203,8 @@ class ClusterSummary {
std::vector< std::vector<double> > GetGenericVariable() const { return genericVariables_; }

//Set the vector genericVariables_ based on the location of the variable within userContent and the module number based on enum CMSTracker
void SetGenericVariable( int variableLocation, int module, double value ) { genericVariablesTmp_[variableLocation][GetModuleLocation(module)] += value; }
void SetGenericVariable( int variableLocation, int module, double value ) {
if(GetModuleLocation(module) >=0) genericVariablesTmp_[variableLocation][GetModuleLocation(module)] += value; }

//Set the vector genericVariables_ given the variable name and the module number based on enum CMSTracker
void SetGenericVariable( std::string variableName, int module, double value ) {
Expand All @@ -220,7 +222,7 @@ class ClusterSummary {
int position = GetVariableLocation(variableName);
int mposition = GetModuleLocation(module);

genericVariablesTmp_[position][mposition] += value;
if(mposition >=0) genericVariablesTmp_[position][mposition] += value;
}

//Prepair the final vector to be put into the producer. Remove any remaining 0's and copy the Tmp to the vector over to genericVariables_. Must be done at the end of each event.
Expand Down
25 changes: 20 additions & 5 deletions trunk/DataFormats/TrackerCommon/src/ClusterSummary.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "DataFormats/TrackerCommon/interface/ClusterSummary.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

int ClusterSummary::GetModuleLocation ( int mod ) const {

Expand All @@ -20,7 +21,8 @@ int ClusterSummary::GetModuleLocation ( int mod ) const {
mod_tmp /= 10;
}

if ( mod_tmp < 5 ){
if ( mod_tmp < 5 ){

if ( mod == (*it) ) {
placeInModsVector = cnt;
break;
Expand All @@ -37,10 +39,10 @@ int ClusterSummary::GetModuleLocation ( int mod ) const {
}

if (placeInModsVector == -1){
std::ostringstream err;
err<<"No information for requested module "<<mod<<". Please check in the Provinence Infomation for proper modules.";

edm::LogWarning("NoModule") << "No information for requested module "<<mod<<". Please check in the Provinence Infomation for proper modules.";

throw cms::Exception( "Missing Module", err.str());
return -1;

}

Expand All @@ -54,6 +56,19 @@ int ClusterSummary::GetVariableLocation ( std::string var ) const {

int placeInUserVector = -1;

/*
int cnt = 0;
for(std::vector<std::string>::const_iterator it = userContent.begin(); it != userContent.end(); ++it) {
if ( var == (*it) ) {
placeInUserVector = cnt;
break;
}
else ++cnt;
}
*/

if ( var == "cHits" )
placeInUserVector = NMODULES;
else if (var == "cSize" )
Expand All @@ -71,7 +86,7 @@ int ClusterSummary::GetVariableLocation ( std::string var ) const {

if (placeInUserVector == -1){
std::ostringstream err;
err<<"No information for requested var "<<var<<". Please check in the Provinence Infomation for proper variables.";
err<<"No information for requested var "<<var<<". Please check if you have chosen a proper variable.";

throw cms::Exception( "Missing Variable", err.str());
}
Expand Down

0 comments on commit f24d9e7

Please sign in to comment.