Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
# -----------------------------------------------------------------------------
# o2o-template_cfg.py : cmsRun configuration file for o2o DCS extraction
#
# Author  : Jo Cole
# Changes : Marco DeMattia
#           Dave Schudel
# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# Import configuration information & define our process
# -----------------------------------------------------------------------------
import FWCore.ParameterSet.Config as cms

process = cms.Process("test")

# -----------------------------------------------------------------------------
# Load our message logger
# -----------------------------------------------------------------------------
process.load("CalibTracker.SiStripDCS.MessLogger_cfi")
# -----------------------------------------------------------------------------
# Define our configuration database service.  
#
# Parameters:
#   ConfDB
#   TNS_ADMIN
#   UsingDb
#   Partitions
# -----------------------------------------------------------------------------

process.SiStripConfigDb = cms.Service("SiStripConfigDb",
    ConfDb = cms.untracked.string('cms_trk_tkcc/PASSWORD@cms_omds_lb'),
    TNS_ADMIN = cms.untracked.string('/opt/cmssw/shifter/o2o_dcs/connection_files'),
    # TNS_ADMIN = cms.untracked.string('/exports/slc4/CMSSW/Development/Users/DeMattia/connection_files'),
    UsingDb = cms.untracked.bool(True),
    Partitions = cms.untracked.PSet(
        PartTIBD = cms.untracked.PSet(
                PartitionName = cms.untracked.string("TI_13-JUN-2009_1"),
                ForceCurrentState = cms.untracked.bool(False),
                ForceVersions = cms.untracked.bool(True), 
                DcuPsuMapVersion = cms.untracked.vuint32(265,1)
                ),
        PartTOB = cms.untracked.PSet(
                PartitionName = cms.untracked.string("TO_30-JUN-2009_1"),
                ForceCurrentState = cms.untracked.bool(False),
                ForceVersions = cms.untracked.bool(True), 
                DcuPsuMapVersion = cms.untracked.vuint32(268,2)
                ),
        PartTECP = cms.untracked.PSet(
                PartitionName = cms.untracked.string("TP_09-JUN-2009_1"),
                ForceCurrentState = cms.untracked.bool(False),
                ForceVersions = cms.untracked.bool(True), 
                DcuPsuMapVersion = cms.untracked.vuint32(266,1)
                ),
         PartTECM = cms.untracked.PSet(
                PartitionName = cms.untracked.string("TM_09-JUN-2009_1"),
                ForceCurrentState = cms.untracked.bool(False),
                ForceVersions = cms.untracked.bool(True), 
                DcuPsuMapVersion = cms.untracked.vuint32(267,1)
                )
        )
)
# -----------------------------------------------------------------------------
# These lines are needed to run an EDAnalyzer without events.  We need to
#   specify an "EmptySource" so it doesn't try to load analysis data when it
#   starts up.  The maxEvents is set to 1 here - this tells the program how
#   many times to call the analyze() method in the EDAnalyzer.
# -----------------------------------------------------------------------------
process.maxEvents = cms.untracked.PSet(
    input = cms.untracked.int32(1)
)
process.source = cms.Source("EmptySource",
    numberEventsInRun = cms.untracked.uint32(1),
    firstRun = cms.untracked.uint32(1)
)


# -----------------------------------------------------------------------------
# Database Setup
# -----------------------------------------------------------------------------
process.load("CondCore.DBCommon.CondDBCommon_cfi")

process.CondDBCommon.connect = cms.string('oracle://cms_omds_nolb/CMS_TRK_DCS_PVSS_COND')

# -----------------------------------------------------------------------------
# Define our SiStripDetVOffBuilder process.  
#
# Parameters:
#   onlineDB            : the connection string for the database.  In  
#                           o2o-template_cfg.py, we save it as 'oracle://cms_omds_nolb/CMS_TRK_DCS_PVSS_COND' - it's
#                           converted to the correct value from the script
#                           run_o2o.sh (so we don't save connection info here)
#   authPath            : <unknown>
#   Tmin                : start date & time to extract data
#   Tmax                : end date & time to extract data
#   TSetMin             : <unknown>
#   queryType           : not needed any more - used to specify LASTVALUE or
#                           STATUSCHANGE query.  We use STATUSCHANGE now.
#   lastValueFile       : not needed
#   lastValueFromFile   : 
#   debugModeOn         : sets debug flag
# -----------------------------------------------------------------------------

process.SiStripDetVOffBuilder = cms.Service(
    "SiStripDetVOffBuilder",
    onlineDB = cms.string('oracle://cms_omds_nolb/CMS_TRK_DCS_PVSS_COND'),
    # authPath = cms.string('/exports/slc4/CMSSW/Development/Users/DeMattia/connection_files'),
    authPath = cms.string('/opt/cmssw/shifter/o2o_dcs/connection_files'),
    
    # Format for date/time vector:  year, month, day, hour, minute, second, nanosecond      
    #     Tmin = cms.untracked.vint32(2009, 11, 23,  4,  0, 0, 000),
    #     Tmax = cms.untracked.vint32(2009, 11, 23,  8,  0, 0, 000),
    
    Tmin = cms.vint32(2009, 12, 12,  00,  0, 0, 000),
    Tmax = cms.vint32(2009, 12, 12,  15,  0, 0, 000),

    # Do NOT change this unless you know what you are doing!
    TSetMin = cms.vint32(2007, 11, 26, 0, 0, 0, 0),                                             
    
    # queryType can be either STATUSCHANGE or LASTVALUE                                
    queryType = cms.string('STATUSCHANGE'),
    
    # if reading lastValue from file put insert file name here                              
    lastValueFile = cms.string(''),
    
    # flag to show if you are reading from file for lastValue or not                              
    lastValueFromFile = cms.bool(False),
    
    # flag to toggle debug output
    debugModeOn = cms.bool(False),
    
    # DetIdFile
    DetIdListFile = cms.string('CalibTracker/SiStripCommon/data/SiStripDetInfo.dat'),
    ExcludedDetIdListFile = cms.string('CalibTracker/SiStripCommon/data/ExcludedSiStripDetInfo.dat'),

    # Threshold to consider an HV channel on
    HighVoltageOnThreshold = cms.double(0.97),

    # Leave empty if you want to use the db
    PsuDetIdMapFile = cms.string("CalibTracker/SiStripDCS/data/PsuDetIdMap.dat")
)

# -----------------------------------------------------------------------------
# Service to write our data to the sqlite db (or Oracle).  This service is 
#   called from the endJob() method of the PopConAnalyzer class (which we have 
#   as SiStripPopConDetVOff) - that's why you won't find a call to it in the
#   DCS code.
#
# Parameters: (need to document..)
#   messageLevel
#   authenticationPath
#   timetype
#   connect
#   toPut
#     record
#     tag
#   logconnect
# -----------------------------------------------------------------------------

process.PoolDBOutputService = cms.Service("PoolDBOutputService",
    BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
    DBParameters = cms.PSet(
        messageLevel = cms.untracked.int32(0),
        authenticationPath = cms.untracked.string('/nfshome0/popcondev/conddb')
        # authenticationPath = cms.untracked.string('/exports/slc4/CMSSW/Development/Users/DeMattia/connection_files')
    ),
    timetype = cms.untracked.string('timestamp'),
    connect = cms.string('sqlite_file:dbfile.db'),
    toPut = cms.VPSet(cms.PSet(
        record = cms.string('SiStripDetVOffRcd'),
        tag = cms.string('SiStripDetVOff_Fake_31X')
    )),
    logconnect = cms.untracked.string('sqlite_file:logfile.db')
)

# -----------------------------------------------------------------------------
# Define a process: Here, we use a descendent of an EDAnalyzer
#   (a PopConAnalyzer)
#
# Parameters:
#   record
#   loggingOn
#   SinceAppendMode
#   Source
#     name
# -----------------------------------------------------------------------------

process.siStripPopConDetVOff = cms.EDAnalyzer("SiStripPopConDetVOff",
    record = cms.string('SiStripDetVOffRcd'),
    loggingOn= cms.untracked.bool(True),
    SinceAppendMode=cms.bool(True),
    Source = cms.PSet(
        DeltaTmin = cms.uint32(15),
        MaxIOVlength = cms.uint32(120)
    )                                        
)



# -----------------------------------------------------------------------------
# Specify the processes to be run.  Here, we only run one.
# -----------------------------------------------------------------------------

process.p = cms.Path(process.siStripPopConDetVOff)